How to Install and Configure Elk - Elastic Search into Centos 7

In this section you will learn How to Install and Configure Elastic Search into Centos 7 part 1
We are going to configure elastic search into three host one master and two slaves
You can see below one master and two slaves on aws console
elastic_search_hosts
Step 1: ssh to all hosts and be the root user
               
sudo -i
                
               
Type the following commands to install all packages into all hosts
               
sudo yum update -y
sudo yum install net-tools wget -y

       
                
               
Create repo file
               
cat > /etc/yum.repos.d/es.repo << EOF
[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF                
               
Install Elastic Search
               
sudo yum update -y
sudo yum install elasticsearch -y
              
               
We have configure etc/hosts file
elastic_search_etc_hosts
Configure Elasticsearch File: we will edit elasticsearch.yml
               
vi /etc/elasticsearch/elasticsearch.yml
                
               
Edit following code into elasticsearch.yml
Below code for master
               
##master

cluster.name: Cloudera-Sam-Cluster
node.name: cmhost.realmprod.local
discovery.zen.ping.unicast.hosts: discovery.zen.ping.unicast.hosts:["cmhost.realmprod.local", "slave1.realmprod.local", "slave2.realmprod.local"]
node.master: true
node.data: false
network.host: ["cmhost", "localhost"]
path.logs: /var/log/elasticsearch
                
               
Below Code for Slaves
               
#######data node

cluster.name: Cloudera-Sam-Cluster
node.name: slave1.realmprod.local
node.master: false
node.data: true
network.host: ["slave1", "localhost"]
discovery.zen.ping.unicast.hosts: ["cmhost.realmprod.local", "slave1.realmprod.local", "slave2.realmprod.local"]
path.logs: /var/log/elasticsearch



cluster.name: Cloudera-Sam-Cluster
node.name: slave2.realmprod.local
node.master: false
node.data: true
network.host: ["slave2", "localhost"]
discovery.zen.ping.unicast.hosts: ["cmhost.realmprod.local", "slave1.realmprod.local", "slave2.realmprod.local"]
path.logs: /var/log/elasticsearch

                
               
Start Elasticsearch:
               
systemctl daemon-reload
systemctl restart elasticsearch
systemctl status elasticsearch
                
               
Congrats Yo have configure elastic search Successfully
successfully_configured_elastics_search_centos
If you want to know more checkout my youtube channel
Configure elastic search into centos 7