Elastic Stack
Introduction
This manual describes the installation procedure for the Elastic Stack (ELK).
Preparation for Installation
This section covers the essential steps required for the installation.
All steps must be executed with root privileges on all nodes, unless otherwise indicated.
To install the ELK, you will need:
Root permission on the server
GBDS installed on the server
If you do not have the file, contact Griaule support team.
Then, follow the steps shown below.
Log in to the server as root.
Prepare the Repository
To install the ELK, first the repository must be added to the server.
To do this, import the GPG key:
Create the repository file:
Add the following content to the file and save it:
Then, update the package manager cache. Start by cleaning the cache:
Finally, rebuild the package cache:
Installing the ELK
Installing and Configuring Elasticsearch
Install the Elasticsearch package:
Then, open the Elasticsearch configuration file:
In the Networksection, look for the line that begins with #network.host:. Uncomment the line and change its value to:
Make sure to replace <host-ip> with the server's IP address.
Next, turn off SSL by changing the following settings to false:
Then, start the Elasticsearch service:
And enable the Elasticsearch service to start automatically on machine boot:
Finally, check if the Elasticsearch service is running:
Make sure to replace <host-ip> with the server's IP address.
The result should be similar to:
Installing and Configuring Kibana
Install the Kibana package:
Then, open the Kibana configuration file:
Look for the line that begins with #server.host:. Uncomment the line and change its value to:
Make sure to replace <hostname> to the server hostname. Keep the double quotes.
Next, look for the line that begins with #elasticsearch.hosts:. Uncomment the line and change its value to:
Make sure to replace <elasticsearch-host-ip> to the IP address configured in Elasticsearch. Keep the double quotes.
Then, start the Kibana service:
And enable the Kibana service to start automatically on machine boot:
Next, install and configure Nginx.
Installing and Configuring Nginx
Install the Nginx package:
Then, create a file that will contain the authentication credentials for Kibana. To do this, run the following command and enter the desired password when prompted:
Then, create a new configuration file for Nginx:
Make sure to replace <hostname> with the server hostname.
Add the following content to the file, making the appropriate changes in server_name and proxy_pass:
Make sure to replace <host-ip> to the server IP address and <kibana-host-ip> to the IP address of the server where Kibana is installed.
Below, the lines containing "^^^^^^^^^" are present only to highlight the changes that should be made. Remove them before saving the file.
Test the Nginx configuration file:
Then, restart the Nginx service:
If necessary, configure the connection in SELinux:
Finally, verify that the Kibana service is running by accessing the following URL in a browser:
Make sure to replace <host-ip> with the server's IP address.
The username is kibanaadmin and the password is the one created above.
Installing and Configuring Logstash
Install the Logstash package:
Then, install the MySQL Connector/J package:
If it is not found, download it at: https://dev.mysql.com/downloads/connector/j/
Then, create the Logstash configuration file:
Add the following content to the file, making the appropriate changes in jdbc_connection_string, jdbc_user, jdbc_password and hosts:
Make sure to replace <database-ip>, <database-username>, <database-password> and <elasticsearch-host-ip> with the appropriate values. Keep the double quotes.
Below, the lines containing "^^^^^^^^^" are present only to highlight the changes that should be made. Remove them before saving the file.
Next, the Logstash systemd file needs to be modified to ensure it is started using the configuration file created earlier. To do this, open the file:
The file may be located at /usr/lib/systemd/system/logstash.service.
Look for the line that begins with ExecStart=. Change its value from:
To:
Then, apply the changes by reloading the systemd configuration:
If you are installing on a new server that has an empty database, insert a dummy value into the table smartsense.load_balancing_count to avoid errors. To do this, run the following command and enter the database password:
Make sure to replace <database-username> and <mysql-database-ip> with the appropriate values.
Then, enable the Logstash service to start automatically on machine boot:
Then, start the Logstash service:
And follow the log:
If an error occurs indicating that Logstash cannot write to the directory /var/lib/logstash/{folder}, run the following command to change its owner:
Finally, to verify that Logstash created the index in Elasticsearch, run the following command:
Make sure to replace <elasticsearch-host-ip> to the IP address of the server where Elasticsearch is installed.
The output should be similar to:
Configuring the ELK with SmartSense
Configuring Kibana
Creating the Data View
Make sure to replace <kibana-host-ip> to the IP address of the server where Kibana is installed.
In a browser, go to: http://<kibana-host-ip>:5601. Then, open the options sidebar by clicking this icon, located in the top left corner of the screen:

Click Management (last section). Then, in the options on the left side, in the Datesection, click Index Management.
Or access the following URL directly:
Make sure that the index smart_sense_index_pattern appears in the list.
Then, in the Kibana section of the left side options, click Data Views.
Click the blue Create data view button and fill in the fields with the following information:
Name:
SS PatternIndex pattern:
smart_sense_index_patternTimestamp field:
load_time
Confirm the creation of the Data View by clicking Save data view to Kibana.
Creating the Dashboards
Open the options sidebar again by clicking the icon in the top left corner of the screen. In the Analytics section, click Dashboards.
Or access the following URL directly:
Click the blue Create dashboard button. Then, click Create visualization. On the right side, configure the visualization with the following information:
Visualization type:
Vertical bar stackedData view:
SS PatternHorizontal Axis:
Functions:
Date histogramField:
load_time
Vertical Axis:
Functions:
SumField:
load_count
Then, click the + symbol, located in the top left corner of the screen, to create a new filter. Configure the filter with the following information: transaction_type is ENROLL. Confirm by clicking Add filter.
Finally, save the dashboard by clicking Save to library, located in the top right corner of the screen, and entering the following information:
Title:
SS Enroll DashboardTags:
smartsense-enroll
Click Save and return.
Repeat the above operations to create the following dashboards:
Adjust the names and tags as necessary.
For VERIFY add the filter:
transaction_typeisVERIFYFor UPDATE add the filter:
transaction_typeisUPDATEFor IDENTIFY add the filter:
transaction_typeisIDENTIFYandlatentisfalseFor LATENT add the filter:
transaction_typeisIDENTIFYandlatentistrue
With the five dashboards created, enter each of them and set the time range to be displayed by clicking the calendar icon, located in the top right corner of the screen.
Then, click Share and Copy link. Save the link, as it will be used later.
Repeat the operation for the five dashboards.
At the end of each link, add the following information:
For example, the link:
Will become:
Repeat the operation for the five obtained links.
Save the links, as they will be used in the next step.
Configuring the Dashboards in SmartSense
Open the SmartSense configuration file, config.properties, located in the folder /var/lib/tomcats/smart-sense/conf:
Find the section # SMARTSENSE - ELK CONFIGURATION.
For each property (linkEnroll, linkIdentify, linkIdentifyLatent, linkUpdate, linkVerify), insert the link of the corresponding dashboard obtained earlier. For example:
Save and close the file.
After completing all the steps of the Elastic Stack installation procedure, go back to the SmartSense Server Configuration manual to finish the configuration.
Last updated
Was this helpful?

