zen.asciidoc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. [[modules-discovery-zen]]
  2. === Zen Discovery
  3. The zen discovery is the built in discovery module for elasticsearch and
  4. the default. It provides unicast discovery, but can be extended to
  5. support cloud environments and other forms of discovery.
  6. The zen discovery is integrated with other modules, for example, all
  7. communication between nodes is done using the
  8. <<modules-transport,transport>> module.
  9. It is separated into several sub modules, which are explained below:
  10. [float]
  11. [[ping]]
  12. ==== Ping
  13. This is the process where a node uses the discovery mechanisms to find
  14. other nodes.
  15. [float]
  16. [[unicast]]
  17. ===== Unicast
  18. The unicast discovery requires a list of hosts to use that will act
  19. as gossip routers. It provides the following settings with the
  20. `discovery.zen.ping.unicast` prefix:
  21. [cols="<,<",options="header",]
  22. |=======================================================================
  23. |Setting |Description
  24. |`hosts` |Either an array setting or a comma delimited setting. Each
  25. value is either in the form of `host:port`, or in the form of
  26. `host:port1-port2`. Note that IPv6 hosts must be bracketed. Defaults to
  27. `127.0.0.1, [::1]`
  28. |=======================================================================
  29. The unicast discovery uses the
  30. <<modules-transport,transport>> module to
  31. perform the discovery.
  32. [float]
  33. [[master-election]]
  34. ==== Master Election
  35. As part of the ping process a master of the cluster is either
  36. elected or joined to. This is done automatically. The
  37. `discovery.zen.ping_timeout` (which defaults to `3s`) allows for the
  38. tweaking of election time to handle cases of slow or congested networks
  39. (higher values assure less chance of failure). Once a node joins, it
  40. will send a join request to the master (`discovery.zen.join_timeout`)
  41. with a timeout defaulting at 20 times the ping timeout.
  42. When the master node stops or has encountered a problem, the cluster nodes
  43. start pinging again and will elect a new master. This pinging round also
  44. serves as a protection against (partial) network failures where node may unjustly
  45. think that the master has failed. In this case the node will simply hear from
  46. other nodes about the currently active master.
  47. If `discovery.zen.master_election.filter_client` is `true`, pings from client nodes (nodes where `node.client` is
  48. `true`, or both `node.data` and `node.master` are `false`) are ignored during master election; the default value is
  49. `true`. If `discovery.zen.master_election.filter_data` is `true`, pings from non-master-eligible data nodes (nodes
  50. where `node.data` is `true` and `node.master` is `false`) are ignored during master election; the default value is
  51. `false`. Pings from master-eligible nodes are always observed during master election.
  52. Nodes can be excluded from becoming a master by setting `node.master` to
  53. `false`. Note, once a node is a client node (`node.client` set to
  54. `true`), it will not be allowed to become a master (`node.master` is
  55. automatically set to `false`).
  56. The `discovery.zen.minimum_master_nodes` sets the minimum
  57. number of master eligible nodes that need to join a newly elected master in order for an election to
  58. complete and for the elected node to accept it's mastership. The same setting controls the minimum number of
  59. active master eligible nodes that should be a part of any active cluster. If this requirement is not met the
  60. active master node will step down and a new mastser election will be begin.
  61. This setting must be set to a quorum of your master eligible nodes. It is recommended to avoid
  62. having only two master eligible nodes, since a quorum of two is two. Therefore, a loss
  63. of either master node will result in an inoperable cluster.
  64. [float]
  65. [[fault-detection]]
  66. ==== Fault Detection
  67. There are two fault detection processes running. The first is by the
  68. master, to ping all the other nodes in the cluster and verify that they
  69. are alive. And on the other end, each node pings to master to verify if
  70. its still alive or an election process needs to be initiated.
  71. The following settings control the fault detection process using the
  72. `discovery.zen.fd` prefix:
  73. [cols="<,<",options="header",]
  74. |=======================================================================
  75. |Setting |Description
  76. |`ping_interval` |How often a node gets pinged. Defaults to `1s`.
  77. |`ping_timeout` |How long to wait for a ping response, defaults to
  78. `30s`.
  79. |`ping_retries` |How many ping failures / timeouts cause a node to be
  80. considered failed. Defaults to `3`.
  81. |=======================================================================
  82. [float]
  83. ==== Cluster state updates
  84. The master node is the only node in a cluster that can make changes to the
  85. cluster state. The master node processes one cluster state update at a time,
  86. applies the required changes and publishes the updated cluster state to all
  87. the other nodes in the cluster. Each node receives the publish message,
  88. updates its own cluster state and replies to the master node, which waits for
  89. all nodes to respond, up to a timeout, before going ahead processing the next
  90. updates in the queue. The `discovery.zen.publish_timeout` is set by default
  91. to 30 seconds and can be changed dynamically through the
  92. <<cluster-update-settings,cluster update settings api>>
  93. [float]
  94. [[no-master-block]]
  95. ==== No master block
  96. For the cluster to be fully operational, it must have an active master and the
  97. number of running master eligible nodes must satisfy the
  98. `discovery.zen.minimum_master_nodes` setting if set. The
  99. `discovery.zen.no_master_block` settings controls what operations should be
  100. rejected when there is no active master.
  101. The `discovery.zen.no_master_block` setting has two valid options:
  102. [horizontal]
  103. `all`:: All operations on the node--i.e. both read & writes--will be rejected. This also applies for api cluster state
  104. read or write operations, like the get index settings, put mapping and cluster state api.
  105. `write`:: (default) Write operations will be rejected. Read operations will succeed, based on the last known cluster configuration.
  106. This may result in partial reads of stale data as this node may be isolated from the rest of the cluster.
  107. The `discovery.zen.no_master_block` setting doesn't apply to nodes based apis (for example cluster stats, node info and
  108. node stats apis) which will not be blocked and try to execute on any node possible.