Elasticsearch error – failed to connect to master

I restarted Elasticsearch and started getting a nasty stack trace in my elasticsearch logs, the key line being

failed to connect to master [[Buzzard][bC1NWlbVT8Wnq7adl3VetA][inet[/192.168.1.2:9300]]] 

There was no ip address like that on my network, it was maddening because no matter what I tried, it kept trying to find that non-existent master node.

Turns out that older versions of elasticsearch (I’m running 19.2 … current version is 20.x) have that problem where stale master id information can be broadcast over the network by a client node. This probably happened because I took my laptop home from work and did a restart of elasticsearch at home (different network/ip address etc)

Eventually I found the solution here.

If you’re getting this error when you go to startup elasticsearch, multicast is probably not working properly. I’m running elasticsearch on a single server (dev environment) and didn’t need all the ceremony.

So I just went into elasticsearch.yml (mine was in /usr/local/Cellar/elasticsearch/0.19.2/config/elasticsearch.yml) and set

discovery.zen.ping.multicast.enabled: false

thats was it. Elasticsearch came right back up!

 

  • ishan0205

    Hey thanks lot..this was really helpful..!

  • concept47

    Glad to hear it!

  • plainblackguy

    Thank you! This was very annoying.

  • concept47

    Glad it helped!

  • Andrew Faulkner

    Thank you so so much!
    I tried everything to make this stop, until I found your post…no problems ever since 🙂

  • Aditya Pn

    Thanks!