In this article I will tell the installation of Kibana on Centos 7. Before reading this article, I suggest you read the following article about Kibana.
First, we are installing java. To install Java you must download the file that is compatible with your system from the link below. If you have already installed, you can skip this step.
Since we are going to install on 64 bit linux system, we are downloading the file below.
Then we create a folder like below to install java. The Java installation is done under the usr/bin folder by default. I’ll make installation in the folder I’ll create below for easier use.
We extract the downloaded java files into the /opt/jdk directory and ensure that the java works from this directory.
tar -zxf server-jre-8u161-linux-x64.tar.gz -C /opt/jdk
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_161/bin/java 100
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_161/bin/javac 100
We set JAVA_HOME using the following commands.
You can download the installation file from the link below.
Since we will install on CENTOS, we download the RPM package and copy it to the server.
You can go to the directory where you copied the RPM package on the server and install Kibana using the following command.
yum install kibana-6.5.4-x86_64.rpm
If you have internet access via the server, you can perform Kibana installation as below.
yum install https://artifacts.elastic.co/downloads/kibana/kibana-6.5.4-x86_64.rpm
Necessary Configurations After Installation
Enable kibana service
We enable kibana service using the command below.
systemctl enable kibana.service
We are editing the kibana.yml file which is the elasticsearch configuration file using the command below.
After opening the file, we configure it as follows. If there is # at the beginning of the line, this line is a comment line or contains an inactive configuration information.
Note: I recommend that you read the lines beginning with #. Because I’ve written some notes.
Do not copy the below yml file. Just change the necessary parameters according to your system.
# Kibana is served by a back end server. This setting specifies the port to use.
#This is my note->your kibana port
# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
#This is my note->Set Your Kibana IP
# Enables you to specify a path to mount Kibana at if you are running behind a proxy.
# Use the `server.rewriteBasePath` setting to tell Kibana if it should remove the basePath
# from requests it receives, and to prevent a deprecation warning at startup.
# This setting cannot end in a slash.
# The maximum payload size in bytes for incoming server requests.
# The Kibana server's name. This is used for display purposes.
# The URL of the Elasticsearch instance to use for all your queries.
# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host
# that connects to this Kibana instance.
# Kibana uses an index in Elasticsearch to store saved searches, visualizations and
# dashboards. Kibana creates a new index if the index doesn't already exist.
# The default application to load.
# If your Elasticsearch is protected with basic authentication, these settings provide
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
#This is my note->the below user is the user that connect to elasticsearch from kibana. You should use search guard or xpack for #user management in Elasticsearch. Otherwise, anyone who has access to the master node through #the corresponding port can access to elasticsearch. you should read the article named "How To #Install Searchguard For Elasticsearch and Kibana(Managing Multiple Indice In Elasticsearch #Seperately and Password Protection on Elasticsearch)"
# If you add the below two line and do not install search guard plugin for kibana, you may receive an error when #you try to start the kibana. That's why if you want to add below two lines, install search guard plugin for kibana.
# These settings enable SSL for outgoing requests from the Kibana server to the browser.
#This is my note->If you are not going to use xpack, you should set it to false as follows.
Start the Kibana
Then, we start the kibana service and check the status.
systemctl start kibana
Check the service status
systemctl status kibana
When you check the status of the service, you may encounter an error as follows.
FATAL Error: EACCES: permission denied, rmdir ‘/usr/share/kibana/optimize/bundles/src/ui’
In this case, run the following commands to restart the kibana service.
chown -R kibana:kibana /etc/kibana/
chown -R kibana:kibana /usr/share/kibana/
Then, you may encounter another error as follows.
Browserslist: caniuse-lite is outdated. Please run next command
npm update caniuse-lite browserslist
We’re running the following command as it tells us, and then we execute the command below and restart it.
npm update caniuse-lite browserslist
npm update autoprefixer
systemctl restart kibana
After Kibana installation is completed, you can open a browser and connect as follows.