Elasticsearch5.2.2 cluster deployment

 

 1. Install the jdk1.8 environment.

 

 2. Install the curl environment.

Window environment download zip package unzip

Add environment variable CURL_HOME value D:\wangl\development_soft\curl-7.53.1

Edit the environment variable Path and add the value at the end;%CURL_HOME%\src

 

 3. Download elasticsearch5.2.2.

Unzip it locally and make two copies.

 

 Four.es cluster

In order to reach the cluster of es, the cluster.name and node.name must be modified.

cluster.name must be consistent.

node.name must be unique.

 

The configuration is as follows:
node1:
 cluster.name: wangl (cluster name)
 node.name: node1 (node ​​name)
 node.master: true (master node)
 node.data: true (data node)
 network.host: 127.0.0.1 (bound ip)
 http.port: 9101 (http service port)
 transport.tcp.port: 9201 (node ​​communication port)
 discovery.zen.minimum_master_nodes: 1 (prevent split brain)
 
node2:
 cluster.name: wangl
 node.name: node2
 node.master: true
 node.data: true
 network.host: 127.0.0.1
 http.port: 9102
 transport.tcp.port: 9202
 discovery.zen.minimum_master_nodes: 1

 

 

 5. Start two es respectively .

curl -XGET localhost:9101/_cluster/health?pretty
return:
{
  "cluster_name" : "wangl",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

 

You can see that the cluster name is wangl, the status is green, and the cluster is successful.

 

 6. Safety Tips

Note: Be sure to bind the intranet ip, and be sure to modify the default port number.

 

 7. Possible reasons for cluster failure

The cluster name is inconsistent, the network connection is not available, there is no master node, and the discovery.zen.minimum_master_nodes setting is incorrect

 

 Eight.discovery.zen.minimum_master_nodes questions

According to the document, this value should be the number of nodes N/2+1, such as two nodes, then it is 2/2+1=2

And in my environment this value of 2 would cause the cluster to fail.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326613587&siteId=291194637