1: Check the current Java JDK version, whether it meets the requirements, download the 2.4. 4 version, and therefore meet the conditions [[Email protected]7 ~]# java-versionOPENJDK version"1.8.0_65"2: Specify the path of the JAVA_HOST environment variableEdit the/etc/profile.d/java.sh file and add export java_home=/usr. /etc/profile.d/java.sh3: Install java-1.8. 0-openjdk-devel.x86_64 bag Yum Install-y java-1.8. 0-openjdk-devel.x86_64 (the JDK should be updated to the latest version here) 4: Download Elasticsearchwget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.4. 4/elasticsearch-2.4. 4.rpm 5: Install ElasticsearchYum Install-y elasticsearch-2.4. 4.rpm 6: Edit configuration file/etc/elasticsearch/elasticsearch.ymlcluster.name:yhy-es (Modify cluster name)node.name:yhy-node-1 (name of the modified node) Transport.tcp.port9300 (default cluster internal communication port)http.port: 9200 (Default introduction data query port) network.host: 0.0. 0. 0 discovery.zen.ping.unicast.hosts: ["192.168.23.10"] discovery.zen.ping.multicast.enabled:true7: Start ElasticsearchSystemctl Daemon-reload (Reload systemd, scan for new or changed units) systemctl start Elasticsearch.service8: Restart two virtual machines as Node2 and Node3 9: Copy environment configuration filescp/etc/profile.d/java.sh192.168.11:/etc/profile.d/ scp/etc/profile.d/java.sh192.168.12:/etc/profile.d/ 10: Execute on the corresponding host. /etc/profile.d/java.sh11: Copy the elasticsearch-2.4. 4.rpm to Node2 and Node3 scp/root/elasticsearch-2.4. 4.rpm 192.168.11:/root scp/root/elasticsearch-2.4. 4.rpm 192.168.12:/root 12: Install separatelyYum Install-y elasticsearch-2.4. 4.rpm 13: Copy the configuration files on the Node1 to Node2 and Node3Scp/etc/elasticsearch/elasticsearch.yml192.168.11:/etc/elasticsearch/ Scp/etc/elasticsearch/elasticsearch.yml192.168.12:/etc/elasticsearch/ 14: Modify the next node name, the cluster name is unchangednode.name:yhy-node-2 (name of the modified node) node.name:yhy-node-3 (name of the modified node) 15: Start the elasticsearch of Node2 and Node3Systemctl daemon-reloadsystemctl Start Elasticsearch.service16: Must ensure that the nodes can communicate with each other directly, grab packets to see message informationTcpdump-i enp0s3-nn TCP port9300
Configure the Java environment to start the service