Setting for option discovery.zen.ping.unicast.hosts in elasticsearch.yml

As per the documentation setting can be - discovery.zen.ping.unicast.hosts: ["host1", "host2"].

Both hosts host1 and host2 are in their private networks e.g. in 20.x.x.x and 30.x.x.x. These 2 networks can't talk to each other.

There are floating IPs to host1 and host2 that can talk to each other on required port(s) but they are say in 192.x.x.x. But IPs in 192.x.x.x are not mapped on local NIC. Hyperviser allows redirects to appropriate host in 20.x.x.x and 30.x.x.x.

What configuration should be done in this case so that host1,host2 can work in one elastic cluster?
Is there any way to make that happen? Or only way is to make 20.x.x.x and 30.x.x.x talk to each other on required port(s)??

If you can give any example config to explain how this can still work using 20.x.x.x,30.x.x.x and 192.x.x.x?

Thanks very much in advance for your inputs.

This sounds like it is going to cause trouble. The simplest plan is really to allow the nodes to talk to each other properly. Elasticsearch assumes each node is accessible from all other nodes at a single address, so there will be difficulties if a node has different addresses depending on the location of the observer on the network.

It's possible that setting network.bind_host to 20.x.x.x or 30.x.x.x and network.publish_host to 192.x.x.x will do what you want, but it's also possible that what you want is not feasible with such a segregated network.

Thanks for reply..
Correct me if my understanding is not right here.. But I think in the suggestion you gave, network.publish_host IP (192.x.x.x) needs to be mapped on one of the NIC cards on the host for it to work, isn't it?

I'm not sure. Did you try it and, if so, were there any messages indicating whether or not it had worked?

I believe that I had tried that long ago..
I will try it again and then confirm..

How should I configure discovery.zen.ping.unicast.hosts: in this case?
I think that this one is a problem. If you configure private IPs(10.x.. and 20.x..), then they can't talk to each other.
If you configure 192.x.x.x, then elasticsearch won't start.. That was my observation from past, hence this question.. Please let me know. Thanks.

discovery.zen.ping.unicast.hosts should be a list containing the 192.x.x.x addresses of the other nodes.

This seems unexpected. What error does it give?

Let me test again..

Tested.. Cluster is formed when you set -
network.bind_host: 0.0.0.0
network.publish_host: 192.x.x.x
discovery.zen.ping.unicast.hosts: 192.x.x.x [of remote host in the cluster]
Now we should be able to use 192.x.x.x for adding data..
My configs look ok?

Thanks for your quick inputs.

1 Like

Looks good to me. Setting bind_host to 0.0.0.0 makes sense if you want it to listen on all available interfaces. Glad to hear it's worked!

Cool.. I will use this now.. Thanks.
Ticket can be closed.

1 Like

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