ES 2.1 only bind on localhost

Hello,

I have my ES 2.1 only listen on localhost however in my configuration i set network.bind_host: ["_em1:ipv4_", "_lo:ipv4_", "_docker0:ipv4_"] and network.publish_host: _em1:ipv4_ any idea ?

I'd use network.host: _em1:ipv4_

Would that work?

The network.host setting is a simple setting to automatically set both network.bind_host and network.publish_host to the same host value.

If i use network.host: em1:ipv4 , my ES 2.1 only listen on em1 iface and i need listening on em1 ,lo and docker0 interfaces

1 Like

In emergency case i use network.host: 0.0.0.0 and my cluster is now listening on all interface but its not a good option

I looked at the code and you should be able to set:

network.bind_host: ["_em1:ipv4_", "_lo:ipv4_", "_docker0:ipv4_"]
network.publish_host: _em1:ipv4_

Can you change the log level to debug and see what is happening?
You should see some lines like:

binding server bootstrap to: XXXXX

I setup a VM with ES 2.1

elasticsearch.yml:

network.bind_host: ["_eth0:ipv4_", "_lo:ipv4_"]
network.publish_host: _eth0:ipv4_
[2015-12-09 15:02:31,319][DEBUG][http.netty               ] [Clea] Bound http to address {127.0.0.1:9200}
[2015-12-09 15:02:31,321][DEBUG][http.netty               ] [Clea] Bound http to address {[::1]:9200}
[2015-12-09 15:02:31,322][INFO ][http                     ] [Clea] publish_address {192.168.0.18:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}

Publish address looks ok but bound addresse failed

Just to make sure. Can you try:

network.bind_host: "NONEXSISTINGADDRESS"

And then:

network.bind_host: [ "NONEXSISTINGADDRESS1", "NONEXSISTINGADDRESS2" ]

Got it. Actually I tried it and when you set it as an array it's ignored!

Opening an issue... See https://github.com/elastic/elasticsearch/issues/15340

So I looked at the wrong code... I was looking at 2.x branch but things changed!

Binding to multiple addresses is only supported in coming 2.2 version: https://github.com/elastic/elasticsearch/pull/13954

1 Like

I've had this issue on Windows Server 2012 R2 and I have workarounded it by setting all
3 parameters to the current machine IP address:

network.host: 192.168.1.100
network.bind_host: 192.168.1.100
network.publish_host: 192.168.1.100

But that disables localhost connections.

To allow localhost on some nodes I've set:

network.bind_host: 0.0.0.0

This work for me... But is this correct?