在同一VPC /子网中的2台EC2服务器上启动ES之前,如何设置正确的配置文件。
大师:
cluster.name: mycluster
node.name: mymaster
cluster.initial_master_nodes: ["172.31.27.57"]
transport.host: localhost
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["172.31.27.57", "172.31.29.50" ]
network.publish_host: 172.31.27.57
http.port: 9200
transport.tcp.port: 9300
从站:
cluster.name: mycluster
node.name: myslave
cluster.initial_master_nodes: ["172.31.27.57"]
transport.host: localhost
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["172.31.27.57", "172.31.29.50" ]
network.publish_host: 172.31.29.50
http.port: 9200
transport.tcp.port: 9300
Master开始正常。 从站显示错误:
[2019-07-16T04:36:48,732][WARN ][o.e.c.c.ClusterFormationFailureHelper] [myslave] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [172.31.27.57] to bootstrap a cluster: have discovered []; discovery will continue using [172.31.27.57:9300, 172.31.29.50:9300] from hosts providers and [{myslave}{sBcCuABrQJSaq7o9RKmd7g}{cSGpsB1URTGqp-TxXX_68A}{localhost}{127.0.0.1:9300}{ml.machine_memory=2088472576, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2019-07-16T04:36:48,763][WARN ][o.e.n.Node ] [myslave] timed out while waiting for initial discovery state - timeout: 30s
[2019-07-16T04:36:48,773][INFO ][o.e.h.AbstractHttpServerTransport] [myslave] publish_address {172.31.29.50:9200}, bound_addresses {[::]:9200}
[2019-07-16T04:36:48,776][INFO ][o.e.n.Node ] [myslave] started
[2019-07-16T04:36:58,734][WARN ][o.e.c.c.ClusterFormationFailureHelper] [myslave] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [172.31.27.57] to bootstrap a cluster: have discovered []; discovery will continue using [172.31.27.57:9300, 172.31.29.50:9300] from hosts providers and [{myslave}{sBcCuABrQJSaq7o9RKmd7g}{cSGpsB1URTGqp-TxXX_68A}{localhost}{127.0.0.1:9300}{ml.machine_memory=2088472576, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
我可以从Slave ping Master:
curl 172.31.27.57:9200
{
"name" : "mymaster",
"cluster_name" : "mycluster",
"cluster_uuid" : "QgTrE44FT-q4QpnZnY5ZXw",
"version" : {
"number" : "7.2.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "508c38a",
"build_date" : "2019-06-20T15:54:18.811730Z",
"build_snapshot" : false,
"lucene_version" : "8.0.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
从Master-> Slave:
curl 172.31.29.50:9200
{
"name" : "myslave",
"cluster_name" : "mycluster",
"cluster_uuid" : "_na_",
"version" : {
"number" : "7.2.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "508c38a",
"build_date" : "2019-06-20T15:54:18.811730Z",
"build_snapshot" : false,
"lucene_version" : "8.0.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}