fix docs, fix another bug in multicast (publish host = bad here!)

This commit is contained in:
Robert Muir 2015-08-17 12:03:03 -04:00
parent 88c462eb30
commit b55d092811
3 changed files with 21 additions and 13 deletions

View file

@ -131,7 +131,9 @@ public class MulticastZenPing extends AbstractLifecycleComponent<ZenPing> implem
boolean deferToInterface = settings.getAsBoolean("discovery.zen.ping.multicast.defer_group_to_set_interface", Constants.MAC_OS_X);
multicastChannel = MulticastChannel.getChannel(nodeName(), shared,
new MulticastChannel.Config(port, group, bufferSize, ttl,
networkService.resolvePublishHostAddress(address),
// don't use publish address, the use case for that is e.g. a firewall or proxy and
// may not even be bound to an interface on this machine! use the first bound address.
networkService.resolveBindHostAddress(address)[0],
deferToInterface),
new Receiver());
} catch (Throwable t) {

View file

@ -38,7 +38,7 @@ respond to. It provides the following settings with the
|`ttl` |The ttl of the multicast message. Defaults to `3`.
|`address` |The address to bind to, defaults to `null` which means it
will bind to all available network interfaces.
will bind `network.bind_host`
|`enabled` |Whether multicast ping discovery is enabled. Defaults to `true`.
|=======================================================================

View file

@ -9,13 +9,15 @@ network settings allows to set common settings that will be shared among
all network based modules (unless explicitly overridden in each module).
The `network.bind_host` setting allows to control the host different network
components will bind on. By default, the bind host will be `anyLoopbackAddress`
(typically `127.0.0.1` or `::1`).
components will bind on. By default, the bind host will be `_local_`
(loopback addresses such as `127.0.0.1`, `::1`).
The `network.publish_host` setting allows to control the host the node will
publish itself within the cluster so other nodes will be able to connect to it.
Of course, this can't be the `anyLocalAddress`, and by default, it will be the
first loopback address (if possible), or the local address.
Currently an elasticsearch node may be bound to multiple addresses, but only
publishes one. If not specified, this defaults to the "best" address from
`network.bind_host`. By default, IPv4 addresses are preferred to IPv6, and
ordinary addresses are preferred to site-local or link-local addresses.
The `network.host` setting is a simple setting to automatically set both
`network.bind_host` and `network.publish_host` to the same host value.
@ -27,21 +29,25 @@ in the following table:
[cols="<,<",options="header",]
|=======================================================================
|Logical Host Setting Value |Description
|`_local_` |Will be resolved to the local ip address.
|`_local_` |Will be resolved to loopback addresses
|`_non_loopback_` |The first non loopback address.
|`_local:ipv4_` |Will be resolved to loopback IPv4 addresses
|`_non_loopback:ipv4_` |The first non loopback IPv4 address.
|`_local:ipv6_` |Will be resolved to loopback IPv6 addresses
|`_non_loopback:ipv6_` |The first non loopback IPv6 address.
|`_non_loopback_` |Addresses of the first non loopback interface
|`_[networkInterface]_` |Resolves to the ip address of the provided
|`_non_loopback:ipv4_` |IPv4 addresses of the first non loopback interface
|`_non_loopback:ipv6_` |IPv6 addresses of the first non loopback interface
|`_[networkInterface]_` |Resolves to the addresses of the provided
network interface. For example `_en0_`.
|`_[networkInterface]:ipv4_` |Resolves to the ipv4 address of the
|`_[networkInterface]:ipv4_` |Resolves to the ipv4 addresses of the
provided network interface. For example `_en0:ipv4_`.
|`_[networkInterface]:ipv6_` |Resolves to the ipv6 address of the
|`_[networkInterface]:ipv6_` |Resolves to the ipv6 addresses of the
provided network interface. For example `_en0:ipv6_`.
|=======================================================================