Handshake failed. unexpected remote node

Hi,

using the elasticsearch docker image docker.elastic.co/elasticsearch/elasticsearch:6.1.2 I can't connect two nodes on different digitalocean droplets. I've created both containers with:

droplet1:
docker run -d -p 9200:9200 -p 9300:9300 --name es1 -h es-asm-1 -v /opt/esdata1:/usr/share/elasticsearch/data -e "cluster.name=btwaf" -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" -e "network.host=0.0.0.0" -e "network.bind_host=0.0.0.0" -e "network.publish_host=0.0.0.0" -e "transport.host=0.0.0.0" --ulimit memlock=-1:-1 docker.elastic.co/elasticsearch/elasticsearch:6.1.2

droplet2:
docker run -d -p 9200:9200 -p 9300:9300 --name es1 -h es-asm-2 -v /opt/esdata1:/usr/share/elasticsearch/data -e "cluster.name=mycluster" -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" -e "discovery.zen.ping.unicast.hosts=droplet1:9300" -e "network.host=0.0.0.0" -e "network.bind_host=0.0.0.0" -e "network.publish_host=0.0.0.0" -e "transport.host=0.0.0.0" --ulimit memlock=-1:-1 docker.elastic.co/elasticsearch/elasticsearch:6.1.2

but on the second node I get this error:

org.elasticsearch.transport.ConnectTransportException: [Bs4USmT][172.17.0.2:9300] handshake failed. unexpected remote node

any idea?

thanks

4 Likes

network.publish_host=0.0.0.0 should be the address that you expect other nodes to use for communication. discovery.zen.ping.unicast.hosts says try talking to one of these hosts to find an elasticsearch cluster. The node it talks to then provides the cluster state, which would contain a list of all the nodes in the cluster + the the address (publish_host) that should be used to establish communication with each of those nodes.

network.bind_host = the interfaces that you want elasticsearch available on
network.host = a shortcut for setting both bind_host and publish_host
https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-network.html#common-network-settings

2 Likes

Did you ever get a solution for this? I can see the answer from Jared is useful, but not sure if this solves the problem. I'm facing a similar issue for which I've posted a separate question.

1 Like

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