# What's the difference between bind\_host and publish\_host in ElasticSearch?

**URL:** <https://discuss.elastic.co/t/whats-the-difference-between-bind-host-and-publish-host-in-elasticsearch/17974>\
**Category:** Elasticsearch\
**Created:** [June 7, 2014, 5:50pm UTC](https://discuss.elastic.co/t/whats-the-difference-between-bind-host-and-publish-host-in-elasticsearch/17974 "2014-06-07T17:50:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flyer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flyer/32/1507_2.png) [@flyer](https://discuss.elastic.co/u/flyer)\
**Post date:** [June 7, 2014, 5:50pm UTC](https://discuss.elastic.co/t/whats-the-difference-between-bind-host-and-publish-host-in-elasticsearch/17974/1 "2014-06-07T17:50:28Z")

</div>

From this document network settings  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-network.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-network.html),  
I know that _publish\_host_ is the host that other nodes in the cluster will  
communicate to. But I don't understand the functionality of _bind\_host_,  
which means that:

The network.bind\_host setting allows to control the host different network  
components will bind on. By default, the bind host will be anyLocalAddress  
(typically 0.0.0.0 or ::0).

And the _network.host_ will set _network.bind\_host_ and  
_network.publish\_host_ to the same value.

So I want to know:

1. the difference between \*network.bind\_host \*and _network.publish\_host_

2. the consequences of setting _network.bind\_host_ and  
_network.publish\_host_ to different values

Thank you very much.

--  
宠辱不惊，闲看庭前花开花落；去留无意，漫随天边云卷云舒。

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKLbBG\_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKLbBG_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 7, 2014, 6:27pm UTC](https://discuss.elastic.co/t/whats-the-difference-between-bind-host-and-publish-host-in-elasticsearch/17974/2 "2014-06-07T18:27:46Z")

</div>

"bind\_host" is the host that an Elasticsearch node uses in the socket bind  
call when starting the network. Due to socket programming model, you can  
"bind" to an address. By referencing an "address", the socket allows access  
to one or all underlying network devices. There are several addresses with  
predefined semantics, e.g. 0.0.0.0 is reserved for "bind to all network  
devices". So the "bind\_host" address does not necessarily reflect a single  
unique address.

"publish\_host" must be a single unique network address. It is used for  
connect calls by other nodes, not for socket bind call by the node itself.  
By using "publish\_host" all nodes and clients can be sure they can connect  
to this node. Declaring this single unique address to the outside can be  
interpreted as "publishing", so it is called "publish\_host".

You can not set "bind\_host" and "publish\_host" to arbitrary values, the  
values must adhere to the underlying socket model.

Jörg

On Sat, Jun 7, 2014 at 7:50 PM, flyer [flyer103@gmail.com](mailto:flyer103@gmail.com) wrote:

> From this document network settings  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-network.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-network.html),  
> I know that _publish\_host_ is the host that other nodes in the cluster  
> will communicate to. But I don't understand the functionality of  
> _bind\_host_, which means that:
> 
> The network.bind\_host setting allows to control the host different network  
> components will bind on. By default, the bind host will be anyLocalAddress  
> (typically 0.0.0.0 or ::0).
> 
> And the _network.host_ will set _network.bind\_host_ and  
> _network.publish\_host_ to the same value.
> 
> So I want to know:
> 
> 1. the difference between \*network.bind\_host \*and  
> _network.publish\_host_
> 2. the consequences of setting _network.bind\_host_ and  
> _network.publish\_host_ to different values
> 
> Thank you very much.
> 
> --  
> 宠辱不惊，闲看庭前花开花落；去留无意，漫随天边云卷云舒。
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAKLbBG\_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKLbBG_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAKLbBG\_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKLbBG_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGqGRzHeSFg0%2BuwxxkomdVi%3D5nx9KhGqFHcYw87Xq5pqw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGqGRzHeSFg0%2BuwxxkomdVi%3D5nx9KhGqFHcYw87Xq5pqw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![flyer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flyer/32/1507_2.png) [@flyer](https://discuss.elastic.co/u/flyer)\
**Post date:** [June 8, 2014, 1:59am UTC](https://discuss.elastic.co/t/whats-the-difference-between-bind-host-and-publish-host-in-elasticsearch/17974/3 "2014-06-08T01:59:00Z")

</div>

Thank you, Jörg.

I neglected the client-server model and now I know the purpose of  
"bind\_host" and "publish\_host"。

On Sun, Jun 8, 2014 at 2:27 AM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<[joergprante@gmail.com](mailto:joergprante@gmail.com)

> wrote:

> "bind\_host" is the host that an Elasticsearch node uses in the socket bind  
> call when starting the network. Due to socket programming model, you can  
> "bind" to an address. By referencing an "address", the socket allows access  
> to one or all underlying network devices. There are several addresses with  
> predefined semantics, e.g. 0.0.0.0 is reserved for "bind to all network  
> devices". So the "bind\_host" address does not necessarily reflect a single  
> unique address.
> 
> "publish\_host" must be a single unique network address. It is used for  
> connect calls by other nodes, not for socket bind call by the node itself.  
> By using "publish\_host" all nodes and clients can be sure they can connect  
> to this node. Declaring this single unique address to the outside can be  
> interpreted as "publishing", so it is called "publish\_host".
> 
> You can not set "bind\_host" and "publish\_host" to arbitrary values, the  
> values must adhere to the underlying socket model.
> 
> Jörg
> 
> On Sat, Jun 7, 2014 at 7:50 PM, flyer [flyer103@gmail.com](mailto:flyer103@gmail.com) wrote:
> 
> > From this document network settings  
> > [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-network.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-network.html),  
> > I know that _publish\_host_ is the host that other nodes in the cluster  
> > will communicate to. But I don't understand the functionality of  
> > _bind\_host_, which means that:
> > 
> > The network.bind\_host setting allows to control the host different  
> > network components will bind on. By default, the bind host will be  
> > anyLocalAddress (typically 0.0.0.0 or ::0).
> > 
> > And the _network.host_ will set _network.bind\_host_ and  
> > _network.publish\_host_ to the same value.
> > 
> > So I want to know:
> > 
> > 1. the difference between \*network.bind\_host \*and  
> > _network.publish\_host_
> > 2. the consequences of setting _network.bind\_host_ and  
> > _network.publish\_host_ to different values
> > 
> > Thank you very much.
> > 
> > --  
> > 宠辱不惊，闲看庭前花开花落；去留无意，漫随天边云卷云舒。
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAKLbBG\_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKLbBG_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAKLbBG\_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKLbBG_B%3DN449d3MxzqTZu3p5DMnXpg8Vy%2BBS5bcZyVD0natsA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGqGRzHeSFg0%2BuwxxkomdVi%3D5nx9KhGqFHcYw87Xq5pqw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGqGRzHeSFg0%2BuwxxkomdVi%3D5nx9KhGqFHcYw87Xq5pqw%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGqGRzHeSFg0%2BuwxxkomdVi%3D5nx9KhGqFHcYw87Xq5pqw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGqGRzHeSFg0%2BuwxxkomdVi%3D5nx9KhGqFHcYw87Xq5pqw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
宠辱不惊，闲看庭前花开花落；去留无意，漫随天边云卷云舒。

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKLbBG\_KrYccT39fjtpb7tuUswTfUrvZ31RgnPHXouMDymBeXg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKLbBG_KrYccT39fjtpb7tuUswTfUrvZ31RgnPHXouMDymBeXg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:23am UTC](https://discuss.elastic.co/t/whats-the-difference-between-bind-host-and-publish-host-in-elasticsearch/17974/4 "2017-07-06T01:23:59Z")

</div>


