voting-exclusions.asciidoc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. [[voting-config-exclusions]]
  2. === Voting configuration exclusions API
  3. ++++
  4. <titleabbrev>Voting configuration exclusions</titleabbrev>
  5. ++++
  6. Adds or removes master-eligible nodes from the
  7. <<modules-discovery-voting,voting configuration exclusion list>>.
  8. [[voting-config-exclusions-api-request]]
  9. ==== {api-request-title}
  10. `POST _cluster/voting_config_exclusions?node_names=<node_names>` +
  11. `POST _cluster/voting_config_exclusions?node_ids=<node_ids>` +
  12. `DELETE _cluster/voting_config_exclusions`
  13. [[voting-config-exclusions-api-desc]]
  14. ==== {api-description-title}
  15. By default, if there are more than three master-eligible nodes in the cluster
  16. and you remove fewer than half of the master-eligible nodes in the cluster at
  17. once, the <<modules-discovery-voting,voting configuration>> automatically
  18. shrinks.
  19. If you want to shrink the voting configuration to contain fewer than three nodes
  20. or to remove half or more of the master-eligible nodes in the cluster at once,
  21. you must use this API to remove departed nodes from the voting configuration
  22. manually. It adds an entry for that node in the voting configuration exclusions
  23. list. The cluster then tries to reconfigure the voting configuration to remove
  24. that node and to prevent it from returning.
  25. If the API fails, you can safely retry it. Only a successful response
  26. guarantees that the node has been removed from the voting configuration and will
  27. not be reinstated.
  28. NOTE: Voting exclusions are required only when you remove at least half of the
  29. master-eligible nodes from a cluster in a short time period. They are not
  30. required when removing master-ineligible nodes or fewer than half of the
  31. master-eligible nodes.
  32. For more information, see <<modules-discovery-removing-nodes>>.
  33. [[voting-config-exclusions-api-query-params]]
  34. ==== {api-query-parms-title}
  35. `node_names`::
  36. A comma-separated list of the names of the nodes to exclude from the voting
  37. configuration. If specified, you may not also specify `?node_ids`.
  38. `node_ids`::
  39. A comma-separated list of the persistent ids of the nodes to exclude from the
  40. voting configuration. If specified, you may not also specify `?node_names`.
  41. `timeout`::
  42. (Optional, <<time-units, time units>>) When adding a voting configuration
  43. exclusion, the API waits for the specified nodes to be excluded from the voting
  44. configuration before returning. The period of time to wait is specified by the
  45. `?timeout` query parameter. If the timeout expires before the appropriate
  46. condition is satisfied, the request fails and returns an error. Defaults to
  47. `30s`.
  48. `wait_for_removal`::
  49. (Optional, boolean) Specifies whether to wait for all excluded nodes to be
  50. removed from the cluster before clearing the voting configuration exclusions
  51. list. Defaults to `true`, meaning that all excluded nodes must be removed from
  52. the cluster before this API takes any action. If set to `false` then the voting
  53. configuration exclusions list is cleared even if some excluded nodes are still
  54. in the cluster.
  55. [[voting-config-exclusions-api-example]]
  56. ==== {api-examples-title}
  57. Adds nodes named `nodeName1` and `nodeName2` to the voting configuration
  58. exclusions list:
  59. [source,console]
  60. --------------------------------------------------
  61. POST /_cluster/voting_config_exclusions?node_names=nodeName1,nodeName2
  62. --------------------------------------------------
  63. Remove all exclusions from the list:
  64. [source,console]
  65. --------------------------------------------------
  66. DELETE /_cluster/voting_config_exclusions
  67. --------------------------------------------------