No route to host error with new ES cluster

So I will post what has allowed this to work for me.

First, I trimmed down the elasticsearch.yml file to the following:

cluster.name: testcluster
node.name: node1
path.data: /opt/elasticsearch/data
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
network.host: [_local_, _em1_]
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["10.0.1.2:9300", "10.0.1.3:9300", "10.0.1.4:9300", "10.0.1.5:9300"]
discovery.zen.minimum_master_nodes: 1
gateway.recover_after_nodes: 3
gateway.expected_nodes: 4
gateway.recover_after_time: 30s

Then, I executed the following commands. It's important to note that I am using Linux Red Hat 7 (RHEL7), which has the firewalld service turned on. This assumes you don't want to switch to another zone in firewalld, and don't mind putting things in the public (default) zone.

firewall-cmd --zone=public --permanent --add-port=9200-9400/tcp
firewall-cmd --zone=public --permanent --add-port=9200-9400/udp
firewall-cmd --zone=public --permanent --add-source=10.0.1.0/24
firewall-cmd --reload

That ensures you have all of the appropriate ports open, and ensures that the network(s) you need access to are available.

3 Likes