voting-exclusions.asciidoc 3.7 KB

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