Installing Elasticsearch and Kibana

Hands-On Lab

 

Photo of Myles Young

Myles Young

BigData Training Architect II in Content

Length

00:30:00

Difficulty

Beginner

Before getting your hands dirty with Elasticsearch, you'll need to know how to install it. In this lab, you will set up a YUM repository on a CentOS 7 server, then install Elasticsearch and Kibana for a small-scale business use case.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Installing Elasticsearch and Kibana

Introduction

Before getting your hands dirty with Elasticsearch, you'll need to know how to install it. In this lab, you will set up a YUM repository on a CentOS 7 server, then install Elasticsearch and Kibana for a small-scale business use case.

Solution

  1. Begin by logging in to the lab server using the credentials provided on the hands-on lab page:

    ssh cloud_user@PUBLIC_IP_ADDRESS
  2. Become the root user:

    sudo su -

Create a YUM repository for Elastic products

  1. Create the YUM repo file at /etc/yum.repos.d/elastic_stack.repo with the following contents:

    vim /etc/yum.repos.d/elastic_stack.repo
    [elastic_stack-6.x]
    name=Elastic Stack repository for 6.x packages
    baseurl=https://artifacts.elastic.co/packages/6.x/yum
    gpgcheck=1
    gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
    enabled=1
    autorefresh=1
    type=rpm-md

Install Java

  1. We need to install Java before installing elasticsearch with the following command:

    yum install java-1.8.0-openjdk -y

Install and enable the Elasticsearch service

  1. With our Elastic repo and Java installed, we can now install Elasticsearch:

    yum install elasticsearch -y
  2. Run the following to prepare, enable, and start the Elasticsearch service:

    systemctl daemon-reload
    systemctl enable elasticsearch
    systemctl start elasticsearch

Install and enable the Kibana service

  1. Install Kibana as follows:

    yum install kibana -y
  2. Run the following to enable and start the Kibana service:

    systemctl enable kibana
    systemctl start kibana
  3. To use Kibana remotely, open a new SSH connection with the following port forwarding options (be sure to replace public_ip with your actual public IP):

    ssh cloud_user@public_ip -L 5601:localhost:5601

    Once you have established the SSH session from the previous step, you can access Kibana by opening your browser and going to http://localhost:5601.

Conclusion

Congratulations — you've completed this hands-on lab!