sudo -i
sudo yum update -y sudo yum install net-tools wget -y
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
sudo yum update -y sudo yum install elasticsearch -y
vi /etc/elasticsearch/elasticsearch.yml
##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
#######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
systemctl daemon-reload systemctl restart elasticsearch systemctl status elasticsearch