user1050619
user1050619

Reputation: 20906

Node not joining in cluster

I'm creating a cluster with multiple(2) nodes but the nodes are not being detected.

Node:-1

cluster.name: mycluster
node.name: NODE1
node.master: true
node.data: true
index.number_of_shards: 5
index.number_of_replicas: 1
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["10.0.2.4"]

Node:-2

cluster.name: mycluster
node.name: NODE2
node.master: false
node.data: true
index.number_of_shards: 5
index.number_of_replicas: 1
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["10.0.2.15"]

With this configuration first I start the master(node1) and the I start the slave(node2) but the slaves are not being detected

I'm able to ping 10.0.2.15 from master and vice versa..

Upvotes: 3

Views: 14032

Answers (3)

Alrik
Alrik

Reputation: 1

This answer is just because first google results brings me here.

ES version 5.1.2

network.host: 0.0.0.0

Helped me to make nodes see each other.

More info: https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-network.html

Upvotes: 0

Val
Val

Reputation: 217554

In addition to specifying the unicast hosts property you also need to set the bind_host property in the elasticsearch.yml file on each of your host and restart them. That's because ES binds to localhost by default as can be seen in the log you posted, i.e. see boldified log below

[2016-01-29 18:18:56,280][INFO ][cluster.service ] [Pixx] new_master {Pixx}{5wg_P7RdT0ykX1q4SAajCA}{127.0.0.1}{127.0.0.1:9300}{master=true}, reason: zen-disco-join(elected_as_master, [0] joins received)

So on node 1, you need this:

network.bind_host: 10.0.2.15

And on node 2 you need this:

network.bind_host: 10.0.2.4

Upvotes: 1

Richa
Richa

Reputation: 7649

You have to enable multicast discovery. Comment the configuration discovery.zen.ping.multicast.enabled: false or set this property to true in elasticsearch.yml

Upvotes: 1

Related Questions