Elasticsearch: network.bind_host affects network.publish_host

Created on 6 Mar 2015  路  4Comments  路  Source: elastic/elasticsearch

Hi,

I am experiencing problems trying to seperate the bind and the publish host address. Obviously the configuration option "network.publish_host" hast no effect, but elasticsearch binds also the publish port (9300) on the interface configured either in "network.host" or "network.bind_host". I am using elasticsearch 1.4.4.

Can anyone reproduce this bug?

Cheers,
Marco

:CorInfrSettings feedback_needed

Most helpful comment

Thank you very much for including the working configuration @clintongormley! I just ran into the same issue as @misterunknown and have been banging my head against a wall. The documentation is worded to lead you to believe that network.bind_host and network.publish_host are the right settings to configure.

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#advanced-network-settings

Since this is such a common configuration maybe it's worth updating the docs to include a warning/tip for this kind of setup?

All 4 comments

Hi @misterunknown

Can you provide the actual settings that you're using, explain what you expect their effect to be and what appears to be different?

There is no point in having a publish host/port that is not also bound.

Hi,

in our testing environment we try to limit access to elasticsearch via an Apache proxy. Therefore elasticsearch only listens on localhost (127.0.0.1:9200). Now we had the intention to build a cluster by adding another host. For cluster communication, elasticsearch should bind to another IP (e.g. 192.168.20.13). Our configuration looks like this:

network.bind_host: 127.0.0.1
network.publish_host: 192.168.20.13

The expected behavoior: Elasticsearch binds 127.0.0.1:9200 and 192.168.20.13:9300 (this one for cluster communication).
The actual behavior: Elasticsearch binds 127.0.0.1:9200 and 127.0.0.1:9300.

Cheers,
Marco

Hi @misterunknown

You appear to be confusing publish/bind with transport/http. Transport is for intra-node communication, which defaults to using port 9300. HTTP is for the REST interface, which defaults to 9200.

However, the bind address is the host/port that Elasticsearch listens to, and the publish address is the host/port the Elasticsearch publicises to other nodes, etc.

So I think what you're actually after is:

transport.host: 192.168.20.13
http.host: 127.0.0.1

Thank you very much for including the working configuration @clintongormley! I just ran into the same issue as @misterunknown and have been banging my head against a wall. The documentation is worded to lead you to believe that network.bind_host and network.publish_host are the right settings to configure.

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#advanced-network-settings

Since this is such a common configuration maybe it's worth updating the docs to include a warning/tip for this kind of setup?

Was this page helpful?
0 / 5 - 0 ratings