Unable to setup elasticsearch cluster

I am trying to setup elasticsearch cluster for production environment. I am using two different hosts.
The config params on elasticsearch.yml are as follows:

node1:
cluster.name: my-cluster-1
node.name: node1
network.host: hostname1
transport.tcp.port: 9300
http.port: 9200

discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.unicast.hosts: ["hostname2"]

node2:
cluster.name: my-cluster-1
node.name: node2
network.host: hostname2
transport.tcp.port: 9300
http.port: 9200

discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.unicast.hosts: ["hostname1"]

When elasticsearch server is started on both nodes(node1 followed by node2), i am getting below error at node2:

[2017-04-25T03:11:00,467][INFO ][o.e.d.z.ZenDiscovery ] [node2] failed to send join request to master [{node1}{B8kpLtbiQEiK40iEDzWgxA}{5VtucMrhSVyEw6IshrVrjw}{hostname1}{10.248.9.42:9300}], reason [RemoteTransportException[[node1][10.248.9.42:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[node2][10.196.25.180:9300] connect_timeout[30s]]; nested: IOException[connection timed out: hostname2/10.196.25.180:9300]; ]

I am able to telnet to 9300 from each host to the other host. Hence I am not sure what is wrong? Kindly help me.

1 Like

That is not best practise, you should use 3 nodes.

These are defaults, there's no need to specify them.

What does that translate to though? It should state it in the logs.

1 Like

This issue has been resolved. The problem was with my cloud VM. It was having 2 IP, one private and one public. When es was started, it was bound to private IP whereas the hostname specified in other discovery.zen.ping.unicast.hosts: ["hostname2"] was resolving to public IP. When I tried the same setup in another non-cloud host, this worked.

1 Like

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