zen.asciidoc 4.9 KB

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