Elasticsearch only binds to localhost but not IP / hostname / fqdn hostname - WHY?

Hi there,
I am wondering: build a multinode stack. On a stack I would llike to to a:
curl -s -k -u elastic:changeme -XGET https://SOMETHING:9200/_cat/health

If SOMETHING is:
127.0.0.1 or localhost it works
machine ip / hostname / fqdn hostanme it does nothing

Running on ubuntu 20.04lts and /etc/hosts has name, fqdn name, ip set.
I tested various elasticsearchy.yml variations, but it does not work.
Any idea why or how?

Running 7.8.1
Doc: Network settings | Elasticsearch Reference [7.8] | Elastic

I would like to bid it to an Ip like 10.16.x.y, so no 192.168.x.y.
cheers
Stefano

You should set network.host, which is the first thing described by the docs you linked. As per those docs it defaults to _local_.

1 Like

At the moment I have this config running:
...

---------------------------------- Network -----------------------------------

Set the bind address to a specific IP (IPv4 or IPv6):

network.host: ["site","local"]
#network.host: ["site"]
#network.host: ["global"]
#network.host: ["global"]
#network.host: ["[ens160]"]
network.publish_host: 10.16.x,y
#network.bind_host: 0
...

...doing this:
network.host: ["site"]
I get the curl check just hanging while directing it to the 10.16.x.y.

network.bind_host and network.publish_host are advanced settings and probably just adding to your confusion.

Just set network.host to the address you want.

...so I did as you said.
Log:
[2021-02-23T13:09:48,771][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [test-prod-master-dus301001-1.logging.msys.net] Active license is now [BASIC]; Security is enabled
[2021-02-23T13:09:48,823][INFO ][o.e.h.AbstractHttpServerTransport] [test-prod-master-dus301001-1.logging.msys.net] publish_address {10.16.x.y:9200}, bound_addresses {10.16.147.205:9200}
[2021-02-23T13:09:48,824][INFO ][o.e.n.Node ] [test-prod-master-dus301001-1.logging.msys.net] started

yml like this:

---------------------------------- Network -----------------------------------

Set the bind address to a specific IP (IPv4 or IPv6):

#network.host: ["site","local"]
#network.host: ["site"]
network.host: ["10.16.x.y"]
#network.host: ["[ens160]"]

network.publish_host: 10.16.147.205

#network.bind_host: 0

Set a custom port for HTTP:

#http.port: 9200

For more information, consult the network module documentation.

But the curl test just hangs with:
curl -s -k -u elastic:changeme -XGET https://10.16.x.y:9200/_cat/health
Any idea why?
Thank you!

Assuming 10.16.x.y is 10.16.147.205 I've no idea. Elasticsearch says it's listening on that address.

Yes, that is the IP. Telnet to that IP an 9200 works well.
Thank you anyway!