How to access ES from hosts other than localhost?

I just have one node where I am running ES and Kibana. In addition to the localhost, I would like to access ES from another host (remote_ip1) as well. But, I would like to avoid setting the network.host to 0.0.0.0. When I put just the 2 hosts I would like to access ES from, it is not starting.

Here's my current elasticsearch.yml:

 path.data: /var/lib/elasticsearch
 path.logs: /var/log/elasticsearch
 network.host: [localhost, remote_ip1]
 discovery.seed_hosts : []
 cluster.initial_master_nodes : []
 http.port: 9200

I am getting the following error:

[2020-08-03T01:56:42,689][ERROR][o.e.b.Bootstrap          ] [localhost] Exception
org.elasticsearch.transport.BindTransportException: Failed to bind to remote_ip1:[9300-9400]

What config changes do I need to make to the elasticsearch.yml to get this working?

That is the 'listening' IP, either localhost or the machines IP or 0.0.0.0 (which is similar) - this is basic TCP/IP config, so for ANY other host to reach this one, set it to either the machine's IP or 0.0.0.0 - the effect is the same.

This is NOT the IP of the client, or other machine, etc. but of what IP the Elasticsearch node listens on - in the TCP world, this is an interface, either localhost/127.0.0.1, an interface IP, or 0.0.0.0 which is all interfaces (which in practice this is usually both localhost and the machine's IP).

So set to 0.0.0.0 and you're done; if you want to limit access to the one other host, use cloud security groups or iptables.

Ah I see. I was under the impression that this was the client’s IP. Thanks for clearing that up.

Yeah, I’m already using UFW to manage the firewall.

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