Handshake failed. unexpected remote node


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:

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=" -e "network.bind_host=" -e "network.publish_host=" -e "transport.host=" --ulimit memlock=-1:-1 docker.elastic.co/elasticsearch/elasticsearch:6.1.2

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=" -e "network.bind_host=" -e "network.publish_host=" -e "transport.host=" --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][] handshake failed. unexpected remote node

any idea?



network.publish_host= 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


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.