Loading...

How to Install ELK Stack (Elasticsearch, Logstash, Kibana) on CentOS 7

Simple.Predictable.Scalable

Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing ELK Stack on CentOS 7

ELK Stack is a popular open-source log management and analytics platform. It is comprised of three main components:

  • Elasticsearch: This is a distributed search and analytics engine that provides real-time visibility into your data.
  • Logstash: This is a data collection pipeline that allows you to collect, process, and enrich your data before sending it to Elasticsearch.
  • Kibana: This is a data visualization and exploration tool that allows you to analyze and visualize the data stored in Elasticsearch.

Prerequisites

Before we start the installation, make sure you have the following prerequisites:

  • A CentOS 7 server with root access.
  • A non-root user with sudo privileges.

Step 1: Install Java

ELK Stack requires Java to run, so let's start by installing Java:

sudo yum install java-1.8.0-openjdk -y

Verify the Java installation by running the following command:

java -version

Step 2: Install Elasticsearch

Next, let's install Elasticsearch:

sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch sudo vi /etc/yum.repos.d/elasticsearch.repo 

Inside the editor, copy and paste the following lines:

[elasticsearch-7.x] name=Elasticsearch repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md 

Save and exit the file. Then, run the following command to install Elasticsearch:

sudo yum install elasticsearch -y

Start and enable Elasticsearch:

sudo systemctl start elasticsearch sudo systemctl enable elasticsearch

Verify the installation by accessing `http://your_server_ip:9200` in your web browser. You should see a response containing Elasticsearch's version information.

Step 3: Install Logstash

Now, let's install Logstash:

sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch sudo vi /etc/yum.repos.d/logstash.repo 

Inside the editor, copy and paste the following lines:

[logstash-7.x] name=Elastic repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md 

Save and exit the file. Then, run the following command to install Logstash:

sudo yum install logstash -y

Start and enable Logstash:

sudo systemctl start logstash sudo systemctl enable logstash

Step 4: Install Kibana

Lastly, let's install Kibana:

sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch sudo vi /etc/yum.repos.d/kibana.repo 

Inside the editor, copy and paste the following lines:

[kibana-7.x] name=Kibana repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md 

Save and exit the file. Then, run the following command to install Kibana:

sudo yum install kibana -y

Start and enable Kibana:

sudo systemctl start kibana sudo systemctl enable kibana

Verify the installation by accessing `http://your_server_ip:5601` in your web browser. You should see the Kibana login screen.

Conclusion

Congratulations! You have successfully installed ELK Stack on your CentOS 7 server. You can now start using Elasticsearch, Logstash, and Kibana to collect, analyze, and visualize your logs and data.

Installing ELK Stack
Elasticsearch
Logstash
Kibana
CentOS 7
ELK Stack installation
ELK Stack setup
CentOS 7 ELK Stack installation
Elasticsearch installation
Logstash installation
Kibana installation

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.