File based discovery does not work

Similar to this ticket - File Based Discovery plugin not working - I've setup a small, two node test cluster that uses docker and is configured to use file based discovery. The configuration directory is mounted/mapped to a directory on my docker host.

Starting two nodes and placing only their own IPs into the unicast_hosts.txt file results in neither server knowing about each other (as expected). However, adding the peer addresses into unicast_hosts.txt on both servers results in no change to the cluster. Discovery never happens.

I can only get the servers to join up if I restart one of the two nodes. Even after they "discovery" each other I cannot get the cluster to size itself dynamically using the contents of the file.

Wonder if others have ever found success with this configuration or if the issue is that ES is running in a docker container and is unable to see that the file has changed.

As you have 2 master-eligible nodes, have you set minimum_master_nodes to 2 according to these guidelines?

Ok. Changing the minimum_master_nodes value "works" in the sense that it forces the new server to continually attempt to perform a master election until the file is updated with just one other node in the established cluster. I'm not sure how this is any better or worse than just configuring the unicast list in elasticsearch.yml and restarting the new node.

Can you clarify why using this discovery method is desirable?

I've also used the EC2 discovery plugin and it seems more "automatic" than this file based method. Removing a node from the security group removes that server from the cluster. I guess stopping elasticsearch is effectively the same. I expected both discovery methods to work more similarly.

It is not a discovery method, but will prevent two separate clusters to be formed (split-brain). As both nodes are required, they do need to reach each other, and will attempt until they do.

Fair enough, thanks

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