Search code examples
elasticsearchdistributed-computing

Nodes not joining cluster in Elasticsearch 5.1 cluster


I want to setup a cluster with 3 nodes(1 master, 1 client and 1 data node) with Elasticsearch 5.1.1. I have connected 3 windows 10 machines through a wireless network and edited the elasticsearch.ymlfile of each node as follows:

master node:

cluster.name: searchapp

node.name: es-master-01
node.master: true
node.data: false
node.ingest: false

network.host: 192.168.1.3

discovery.zen.ping.unicast.hosts: ["es-client-01", "es-master-01",  "es-data-01"]

client node:

cluster.name: searchapp

node.name: es-client-01
node.master: false
node.data: false
node.ingest: true

network.host: 192.168.1.4

discovery.zen.ping.unicast.hosts: ["es-client-01", "es-master-01",  "es-data-01"]

data node:

cluster.name: searchapp

node.name: es-data-01
node.master: false
node.data: true
node.ingest: false

network.host: 192.168.1.2

discovery.zen.ping.unicast.hosts: ["es-client-01", "es-master-01",  "es-data-01"]

When I try to run elasticsearch on the master node it gives the following output enter image description here

The nodes are not joining the cluster and I tried replacing the hostnames to IPs but still the nodes aren't joining.


Solution

  • According to the attached logs, it seems that your elasticsearch cluster cannot resolve the host names for the machines.

    I suggest to add all of your hosts names to the hosts file so each machine would know how to resolve the host names.

    For linux:

    /etc/hosts
    

    For windows:

    %SystemRoot%\System32\drivers\etc\hosts
    

    Where by default, %SystemRoot% means: C:\Windows