OpenSearch/docs/reference/modules/discovery/zen.asciidoc

138 lines
6.2 KiB
Plaintext
Raw Normal View History

[[modules-discovery-zen]]
=== Zen Discovery
The zen discovery is the built in discovery module for elasticsearch and
the default. It provides unicast discovery, but can be extended to
support cloud environments and other forms of discovery.
The zen discovery is integrated with other modules, for example, all
communication between nodes is done using the
<<modules-transport,transport>> module.
It is separated into several sub modules, which are explained below:
[float]
[[ping]]
==== Ping
This is the process where a node uses the discovery mechanisms to find
other nodes.
[float]
[[unicast]]
===== Unicast
The unicast discovery requires a list of hosts to use that will act
as gossip routers. It provides the following settings with the
`discovery.zen.ping.unicast` prefix:
[cols="<,<",options="header",]
|=======================================================================
|Setting |Description
|`hosts` |Either an array setting or a comma delimited setting. Each
value should be in the form of `host:port` or `host` (where `port` defaults to `9300`). Note that IPv6 hosts must be bracketed. Defaults to
Default to unicast discovery, with default host list of 127.0.0.1, [::1] Fix unicast discovery to work when a host has multiple addresses. Ban dangerous methods in java.net with forbidden APIs. Fix ipv6 bugs and formatting of network addresses everywhere. Closes #12999 Closes #12993 Squashed commit of the following: commit 6c1aa001d091c5cf25212a53dc701fb704337f1e Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 14:25:43 2015 -0400 Fix these to be correct with addresses just in case commit 648215627e84abf58a71400e7dc9ae775efb71d6 Merge: d00561b 41d8fbe Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 13:23:09 2015 -0400 Merge branch 'master' into unicast_all_the_way_down commit d00561b76fd1aa5850699f7901f3dae3d4d402b7 Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 16:38:50 2015 +0200 limit local ports to 5 in UnicastZenPing commit e2e15c594006746cbe24432694294a71cc99deb8 Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 10:32:47 2015 -0400 fix port limiting commit 10153cb7adadda81a1f482445e703836b65cf5e2 Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 10:18:37 2015 -0400 don't serialize scopeids: that's broken commit 2aa63d43db2baec68a2e9bc227cfeb85dfeb4f83 Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 16:06:51 2015 +0200 restore @Network commit c840f1d1ef438826ae1ecfd5e45942a0e30dc9c0 Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 16:02:30 2015 +0200 Use NetworkAddress.formatAddress where applicable in plugins commit 374ce878852b35d626b7a29c8c4773545b0e9ddd Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 15:34:06 2015 +0200 Use NetworkAddress.formatAddress where applicable commit e7a606d63f1bc43c1b62b6e17adf707c76d43a15 Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 10:17:57 2015 +0200 Add @Multicast annotation to disable multicast tests by default. We only run multicast tests now when we explicitly state it. A working multicast env is required which is not always the case. commit 2d7d2d0347179696ab41f71f048b13305014c85b Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 09:51:28 2015 +0200 Remove extra check for local mode in InternalTestCluster commit dda59ac39aa136d4687b9274c2692cd77f8b8f66 Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 09:37:03 2015 +0200 Handle node mode across entire test cluster We used static methods reading sys properties to define the node mode per cluster. this had lots of problems when tests couldn't cope with mixed or only local mode. Now we are passing it down to the cluster from the test which allows to @SuppressNetworkMode / @SupressLocalMode on the test to force consistent node configurations. commit 058197b7a408318995c88ce7f6762e32348de0de Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 03:19:14 2015 -0400 really ban InetSocketAddress's trappy method and break build and go to sleep, sorry commit ac8779185aee1e17e6f5a81766290fdfc9c603ba Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 03:16:52 2015 -0400 Ban methods that might surprisingly cause DNS lookups commit e64fe3dff2b11503e5f2831eb9863d64f56c5538 Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 02:59:05 2015 -0400 Add unit test commit f15434f20fb1a3691b1cc16028597d8fae937e05 Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 02:39:02 2015 -0400 fix ipv6 formatting bugs commit 05c2c74098052c75fbb79ea1818a295ef2e03e30 Author: Robert Muir <rmuir@apache.org> Date: Thu Aug 20 02:12:05 2015 -0400 format addresses correctly so I can actually read what comes out of our logs and stats apis commit 4f9389dcf1e8925f23153c5eb271b4ce2294dbaf Author: Robert Muir <rmuir@apache.org> Date: Wed Aug 19 21:26:52 2015 -0400 ban dangerous methods in java.net commit 6aacd4d9925f324903d1d099a6cf5f862aeaf677 Author: Robert Muir <rmuir@apache.org> Date: Wed Aug 19 20:59:24 2015 -0400 ban lenient method commit f466a842c60163d1f4554bdce8a4163edb534c2c Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 00:29:00 2015 +0200 fix tests to not mix local transport and zen unicast disco commit 0de007a33b33fb68cf85cd86db4ca4f8ce10bbc9 Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 00:10:07 2015 +0200 fix tests to not mix local transport and zen unicast disco commit 539f6ca6e5137e0d496239adc8684688dedcc824 Author: Simon Willnauer <simonw@apache.org> Date: Thu Aug 20 00:02:01 2015 +0200 fix tests to not mix local transport and zen unicast disco commit 004c2881b25467f332acc8c9f9e92b1f0f9d314e Author: Robert Muir <rmuir@apache.org> Date: Wed Aug 19 17:51:45 2015 -0400 Fix multinode commit 54113af325ce31571811c49fdaae89d5687be4ba Author: Robert Muir <rmuir@apache.org> Date: Wed Aug 19 17:36:45 2015 -0400 fix integration tests commit 0156a77a56319d6b9737ec6a531992052e50bd59 Author: Simon Willnauer <simonw@apache.org> Date: Wed Aug 19 23:32:18 2015 +0200 enable multicast in MulticastZenPingIT.java commit 1791caa35da853ce0122485fa3fd4674c671ec6e Author: Robert Muir <rmuir@apache.org> Date: Wed Aug 19 17:23:16 2015 -0400 Fix constant commit 22820b53e0b2dc9fd47145c2bc29ce912a8fd484 Author: Simon Willnauer <simonw@apache.org> Date: Wed Aug 19 22:59:09 2015 +0200 give it some extra ids for local transport crazyness commit b2138fafa94a8a085813fd48356df63e57ade5b3 Author: Simon Willnauer <simonw@apache.org> Date: Wed Aug 19 22:51:42 2015 +0200 pass on local addresses from configured transport rather than hard code IP addresses commit 1bf5de1f457b081e0ce262b57d2b55d39c434156 Author: Simon Willnauer <simonw@apache.org> Date: Wed Aug 19 22:04:31 2015 +0200 fix PluggableTransportModuleIT.java to use local disco and detach port limit for node local disco commit b6706eddfa04c43947c16551359ae98a463d34aa Author: Robert Muir <rmuir@apache.org> Date: Wed Aug 19 14:16:03 2015 -0400 Default to unicast discovery, with default host list of 127.0.0.1, [::1]
2015-08-20 14:26:40 -04:00
`127.0.0.1, [::1]`
|=======================================================================
The unicast discovery uses the
<<modules-transport,transport>> module to
perform the discovery.
[float]
[[master-election]]
==== Master Election
As part of the ping process a master of the cluster is either
elected or joined to. This is done automatically. The
`discovery.zen.ping_timeout` (which defaults to `3s`) allows for the
tweaking of election time to handle cases of slow or congested networks
(higher values assure less chance of failure). Once a node joins, it
will send a join request to the master (`discovery.zen.join_timeout`)
with a timeout defaulting at 20 times the ping timeout.
When the master node stops or has encountered a problem, the cluster nodes
start pinging again and will elect a new master. This pinging round also
serves as a protection against (partial) network failures where a node may unjustly
think that the master has failed. In this case the node will simply hear from
other nodes about the currently active master.
If `discovery.zen.master_election.ignore_non_master_pings` is `true`, pings from nodes that are not master
eligible (nodes where `node.master` is `false`) are ignored during master election; the default value is
`false`.
Nodes can be excluded from becoming a master by setting `node.master` to `false`.
The `discovery.zen.minimum_master_nodes` sets the minimum
number of master eligible nodes that need to join a newly elected master in order for an election to
2016-07-26 13:59:33 -04:00
complete and for the elected node to accept its mastership. The same setting controls the minimum number of
active master eligible nodes that should be a part of any active cluster. If this requirement is not met the
2016-02-04 17:12:51 -05:00
active master node will step down and a new master election will be begin.
This setting must be set to a quorum of your master eligible nodes. It is recommended to avoid
having only two master eligible nodes, since a quorum of two is two. Therefore, a loss
of either master eligible node will result in an inoperable cluster.
[float]
[[fault-detection]]
==== Fault Detection
There are two fault detection processes running. The first is by the
master, to ping all the other nodes in the cluster and verify that they
are alive. And on the other end, each node pings to master to verify if
its still alive or an election process needs to be initiated.
The following settings control the fault detection process using the
`discovery.zen.fd` prefix:
[cols="<,<",options="header",]
|=======================================================================
|Setting |Description
|`ping_interval` |How often a node gets pinged. Defaults to `1s`.
|`ping_timeout` |How long to wait for a ping response, defaults to
`30s`.
|`ping_retries` |How many ping failures / timeouts cause a node to be
considered failed. Defaults to `3`.
|=======================================================================
[float]
==== Cluster state updates
The master node is the only node in a cluster that can make changes to the
cluster state. The master node processes one cluster state update at a time,
applies the required changes and publishes the updated cluster state to all
2015-08-25 09:03:17 -04:00
the other nodes in the cluster. Each node receives the publish message, acknowledges
2015-08-25 10:14:08 -04:00
it, but does *not* yet apply it. If the master does not receive acknowledgement from
2015-08-25 09:03:17 -04:00
at least `discovery.zen.minimum_master_nodes` nodes within a certain time (controlled by
the `discovery.zen.commit_timeout` setting and defaults to 30 seconds) the cluster state
change is rejected.
Once enough nodes have responded, the cluster state is committed and a message will
2015-08-25 10:14:08 -04:00
be sent to all the nodes. The nodes then proceed to apply the new cluster state to their
2015-08-25 09:03:17 -04:00
internal state. The master node waits for all nodes to respond, up to a timeout, before
going ahead processing the next updates in the queue. The `discovery.zen.publish_timeout` is
set by default to 30 seconds and is measured from the moment the publishing started. Both
timeout settings can be changed dynamically through the <<cluster-update-settings,cluster update settings api>>
[float]
[[no-master-block]]
==== No master block
For the cluster to be fully operational, it must have an active master and the
number of running master eligible nodes must satisfy the
`discovery.zen.minimum_master_nodes` setting if set. The
`discovery.zen.no_master_block` settings controls what operations should be
rejected when there is no active master.
The `discovery.zen.no_master_block` setting has two valid options:
[horizontal]
`all`:: All operations on the node--i.e. both read & writes--will be rejected. This also applies for api cluster state
read or write operations, like the get index settings, put mapping and cluster state api.
`write`:: (default) Write operations will be rejected. Read operations will succeed, based on the last known cluster configuration.
This may result in partial reads of stale data as this node may be isolated from the rest of the cluster.
2016-07-27 14:02:56 -04:00
The `discovery.zen.no_master_block` setting doesn't apply to nodes-based apis (for example cluster stats, node info and
node stats apis). Requests to these apis will not be blocked and can run on any available node.