Elasticsearch MultiNode Cluster Configuration


(Hassan Shaitou) #1

I have two nodes I want one to act as a master(master node) the second to act as a slave(data node):

master node configuration:

cluster.name: twist
node.master: true
node.data: false
node.name: 192.168.237.131
discovery.zen.ping.unicast.hosts: ["192.168.237.131","192.168.237.132"]

data node configuration:

cluster.name: twist
node.master: false
node.data: true
node.name: 192.168.237.132
discovery.zen.ping.unicast.hosts: ["192.168.237.131","192.168.237.132"]

but, the problem I am getting the following warning

[2018-02-21T07:53:52,506][WARN ][o.e.d.z.ZenDiscovery ] [192.168.237.131] not enough master nodes discovered during pinging (found [[]], but needed [-1]), pinging again

in addition I checked the cluster on the master node by running the following command line:

curl http://192.168.237.131:9200/_cluster/health?pretty

I only get one master node which is my machine, and 0 data nodes !
I am using ES version 6.0.0
any configuration missing ? Thanks in adnvance...


(David Pilato) #2

Just to make sure you understand, I'd like to highlight that there is no such master/slave mechanism in elasticsearch.

We do have master elligible nodes that can control the cluster state.
We do have data nodes that can have indices allocated on them (data on disk).
And nodes can do both.

In the context of a 2 nodes cluster, that does not sound a good idea to dedicate nodes to do master and the other to do only data.

Anyway, the problem here is that you did not set network.host I think.

Another comment: you need 3 nodes to be safer for production. My advice would be to have at least:

  • 2 data/master nodes
  • 1 master only node (which can be much lighter in term of memory and can use spinning disk)

(Hassan Shaitou) #3

I will check network.host, yah I read about it that a node can do both roles as master and data I meant by slave node the nodes who do the data part. Thanks for replying and clarifying things.


(Hassan Shaitou) #4

sorry for bothering,I changed my settings on Master/Data machine(1-2) (I made both machines as Master/Data Nodes)

My updated configuration:

 http.port: 9200
 http.host: 0.0.0.0
 node.master: true
 node.data: true
 node.ingest: false
 network.host: 127.0.0.1
 transport.host: 192.168.237.132
 node.name: 192.168.237.132
 discovery.zen.ping.unicast.hosts: ["192.168.237.131","192.168.237.132"]

But I am still getting this error:

[2018-02-21T23:37:47,039][INFO ][o.e.b.BootstrapChecks ] [192.168.237.132] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed


(Hassan Shaitou) #5

Sorry for bothering again, the IP 192.168.237.132 is not resolved in the /etc/hosts I replaced it by "localhost" and the elastic is now running, but still the nodes are not connected ! Am I still missing a configuration option?


(David Pilato) #6

Please read https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html


(Hassan Shaitou) #7

thanks thanks I read it, it worked now, by the way it's not the issue thanks anyways, I just added my machine IP to the /etc/hosts and it is working like charm. Thanks again...


(system) #8

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.