zen.asciidoc 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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 both multicast and unicast discovery as well
  5. being easily extended to support cloud environments.
  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. There is support for both multicast and unicast based
  15. discovery (can be used in conjunction as well).
  16. [float]
  17. [[multicast]]
  18. ===== Multicast
  19. Multicast ping discovery of other nodes is done by sending one or more
  20. multicast requests where existing nodes that exists will receive and
  21. respond to. It provides the following settings with the
  22. `discovery.zen.ping.multicast` prefix:
  23. [cols="<,<",options="header",]
  24. |=======================================================================
  25. |Setting |Description
  26. |`group` |The group address to use. Defaults to `224.2.2.4`.
  27. |`port` |The port to use. Defaults to `54328`.
  28. |`ttl` |The ttl of the multicast message. Defaults to `3`.
  29. |`address` |The address to bind to, defaults to `null` which means it
  30. will bind to all available network interfaces.
  31. |=======================================================================
  32. Multicast can be disabled by setting `multicast.enabled` to `false`.
  33. [float]
  34. [[unicast]]
  35. ===== Unicast
  36. The unicast discovery allows to perform the discovery when multicast is
  37. not enabled. It basically requires a list of hosts to use that will act
  38. as gossip routers. It provides the following settings with the
  39. `discovery.zen.ping.unicast` prefix:
  40. [cols="<,<",options="header",]
  41. |=======================================================================
  42. |Setting |Description
  43. |`hosts` |Either an array setting or a comma delimited setting. Each
  44. value is either in the form of `host:port`, or in the form of
  45. `host[port1-port2]`.
  46. |=======================================================================
  47. The unicast discovery uses the
  48. <<modules-transport,transport>> module to
  49. perform the discovery.
  50. [float]
  51. [[master-election]]
  52. ==== Master Election
  53. As part of the initial ping process a master of the cluster is either
  54. elected or joined to. This is done automatically. The
  55. `discovery.zen.ping_timeout` (which defaults to `3s`) allows to
  56. configure the election to handle cases of slow or congested networks
  57. (higher values assure less chance of failure).
  58. Nodes can be excluded from becoming a master by setting `node.master` to
  59. `false`. Note, once a node is a client node (`node.client` set to
  60. `true`), it will not be allowed to become a master (`node.master` is
  61. automatically set to `false`).
  62. The `discovery.zen.minimum_master_nodes` allows to control the minimum
  63. number of master eligible nodes a node should "see" in order to operate
  64. within the cluster. Its recommended to set it to a higher value than 1
  65. when running more than 2 nodes in the cluster.
  66. [float]
  67. [[fault-detection]]
  68. ==== Fault Detection
  69. There are two fault detection processes running. The first is by the
  70. master, to ping all the other nodes in the cluster and verify that they
  71. are alive. And on the other end, each node pings to master to verify if
  72. its still alive or an election process needs to be initiated.
  73. The following settings control the fault detection process using the
  74. `discovery.zen.fd` prefix:
  75. [cols="<,<",options="header",]
  76. |=======================================================================
  77. |Setting |Description
  78. |`ping_interval` |How often a node gets pinged. Defaults to `1s`.
  79. |`ping_timeout` |How long to wait for a ping response, defaults to
  80. `30s`.
  81. |`ping_retries` |How many ping failures / timeouts cause a node to be
  82. considered failed. Defaults to `3`.
  83. |=======================================================================
  84. [float]
  85. ==== External Multicast
  86. The multicast discovery also supports external multicast requests to
  87. discover nodes. The external client can send a request to the multicast
  88. IP/group and port, in the form of:
  89. [source,js]
  90. --------------------------------------------------
  91. {
  92. "request" : {
  93. "cluster_name": "test_cluster"
  94. }
  95. }
  96. --------------------------------------------------
  97. And the response will be similar to node info response (with node level
  98. information only, including transport/http addresses, and node
  99. attributes):
  100. [source,js]
  101. --------------------------------------------------
  102. {
  103. "response" : {
  104. "cluster_name" : "test_cluster",
  105. "transport_address" : "...",
  106. "http_address" : "...",
  107. "attributes" : {
  108. "..."
  109. }
  110. }
  111. }
  112. --------------------------------------------------
  113. Note, it can still be enabled, with disabled internal multicast
  114. discovery, but still have external discovery working by keeping
  115. `discovery.zen.ping.multicast.enabled` set to `true` (the default), but,
  116. setting `discovery.zen.ping.multicast.ping.enabled` to `false`.