2

I have three elasticsearch nodes set up within my VPN which are unable to form a cluster. The three machines have generic names, e.g. abc01.company.com, that I use to ssh into them. I can retrieve the cluster status of any machine from any other using curl, curl abc01.company.com/_cluster/health?pretty=true, but each machine thinks its a single node-cluster. I have made the following changes to the config file:

cluster.name: cluster-name
node.name: node_1

discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["abc02.company.com:9200", "abc03.company.com:9200"]

network.bind_host: 0.0.0.0
network.publish_host: abc01.company.com

The config files for the other two nodes are similar, with corresponding changes made to node.name, discovery.zen.ping.unicast.hosts, and network.publish_host.

1 Answer 1

3

i faced the same issue sometime back. the fix is,

discovery.zen.ping.unicast.hosts should point to the master nodes. From you question it is not clear which nodes are master, data , client etc.

Lets say,abc02.company.com is your master node and remaining nodes are data nodes. try the following configuration in all the three nodes

discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["abc02.company.com","[::1]"]

node.master=true will set as master node
node.master=false and node.data=true will make a nodes as data node
node.client=true will make a node as client and a client code can neither be server not be data node
Sign up to request clarification or add additional context in comments.

4 Comments

Added "[::1]" as the second option and my local nodes are connecting to a cluster. Try! this should work
Thank you so much, that did it for me! I hadn't specified which node was master and which nodes were data before. Just out of curiosity, would one of the data nodes take over if the master node went down? And do you always need to specify which nodes are master and which are data when using unicast?
Nope! only data nodes can never be master. we should have more masters in the clusters to improve availability. Also masters can also for data node work. Yes! we have to specify which nodes are master in the unicast.
Got it! I have a three node cluster, so I think I will make all three master and data nodes to make the cluster more resilient. Thanks for all the help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.