Installation
As a best practice, make sure your version of Kibana matches the version of Elasticsearch, otherwise we might get issues when connecting with each other. You can get the version of Elasticsearch from the previous step - when we test the Elasticsearch instance making a request to the public hostname, one of the attributes in the response is the version. In this tutorial, this is version 8.15.3.Before downloading the Kibana package, let’s have a look at the versions available for Kibana in our package manager
sudo apt list kibana -a
Now that we’re sure the version we require is available we proceed to the installation with the following command
sudo apt-get install kibana=[VERSION]
Setup
Next, set up our Kibana installation. From a text editor open the kibana configuration file located at /etc/kibana/kibana.ymlsudo vi /etc/kibana/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
server.name: "mule-kibana"
elasticsearch.hosts: ["http://localhost:9200"]
elasticsearch.serviceAccountToken: "[YOUR_KIBANA_TOKEN]"
In some versions of ELK, we’ve got the option of not modifying anything under the System: Elastcisearch section, leave all the parameters within comments. In that case, the connection between Kibana and Elasticsearch we’ll be done via the UI, when we’ll first access Kibana (see the section below ...)
Install Kibana as a Service
- Configure Kibana to start automatically when the system boots up
sudo systemctl daemon-reload
sudo systemctl enable kibana.service
- Kibana can be started as follows
sudo systemctl start kibana
sudo systemctl status kibana
Verify the installation
Open your web browser and navigate to http://[YOUR_SERVER]:5601 . Depending on whether or not you provide the service account token to Kibana in the Kibana config file, the Welcome page will be different:Case 1: Kibana enrollment completed
If you provided the service access token, you should see the login page. Provide username and password (your elastic user).Click Log in. You should now see the Kibana UI ready to use
Case 2: Kibana enrollment not completed
If you didn’t provide any configuration to connect to Elastisearch, after starting Kibana the service status will tell you the configuration is not completed.Now, if you open your web browser and go to http://[YOUR_SERVER_NAME]:5601
It will prompt you for an enrollment token.
It will prompt you for an enrollment token.
This is the token that Kibana will use to authenticate to our Elasticsearch instance. To generate this token, run the following command:
This is the token that Kibana will use to authenticate to our Elasticsearch instance. For that, run the following command:
This is the token that Kibana will use to authenticate to our Elasticsearch instance. For that, run the following command:
sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
Copy the token and paste it in the welcome page. Notice that, once it has the token, Kibana automatically detects the local Elasticsearch instance
Click Configure Elastic. You will then be asked for a Verification code
The verification code should be in the Kibana logs. Type the following to retrieve the code:
sudo su
/usr/share/kibana/bin/kibana-verification-code
Provide the code. Kibana will start the setup
Once it’s done, provide username and password to access Kibana
Click Log in. You should now see the Kibana UI ready to use
With that, we’ve got a fully working Elastic instance. But before we can start sending any metrics or logs we’ll need to prepare Elastic for our Mule apps. We’ll see it in our next post - How to Set up Elastic for our Mule Logs