voting-exclusions.asciidoc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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
  26. nodes or to remove half or more of the master-eligible nodes in the cluster at
  27. once, use this API to remove departing nodes from the voting configuration
  28. manually. The API adds an entry for each specified node to the cluster's voting
  29. configuration exclusions list. It then waits until the cluster has reconfigured
  30. its voting configuration to exclude the specified nodes.
  31. Clusters should have no voting configuration exclusions in normal operation.
  32. Once the excluded nodes have stopped, clear the voting configuration exclusions
  33. with `DELETE /_cluster/voting_config_exclusions`. This API waits for the nodes
  34. to be fully removed from the cluster before it returns. If your cluster has
  35. voting configuration exclusions for nodes that you no longer intend to remove,
  36. use `DELETE /_cluster/voting_config_exclusions?wait_for_removal=false` to clear
  37. the voting configuration exclusions without waiting for the nodes to leave the
  38. cluster.
  39. If the API fails, you can safely retry it. Only a successful response
  40. guarantees that the node has been removed from the voting configuration and
  41. will not be reinstated.
  42. NOTE: Voting exclusions are required only when you remove at least half of the
  43. master-eligible nodes from a cluster in a short time period. They are not
  44. required when removing master-ineligible nodes or fewer than half of the
  45. master-eligible nodes.
  46. For more information, see <<modules-discovery-removing-nodes>>.
  47. [[voting-config-exclusions-api-query-params]]
  48. ==== {api-query-parms-title}
  49. `node_names`::
  50. A comma-separated list of the names of the nodes to exclude from the voting
  51. configuration. If specified, you may not also specify `?node_ids`. Only applies
  52. to the `POST` form of this API.
  53. `node_ids`::
  54. A comma-separated list of the persistent ids of the nodes to exclude from the
  55. voting configuration. If specified, you may not also specify `?node_names`.
  56. Only applies to the `POST` form of this API.
  57. `timeout`::
  58. (Optional, <<time-units, time units>>) When adding a voting configuration
  59. exclusion, the API waits for the specified nodes to be excluded from the voting
  60. configuration before returning. The period of time to wait is specified by the
  61. `?timeout` query parameter. If the timeout expires before the appropriate
  62. condition is satisfied, the request fails and returns an error. Defaults to
  63. `30s`. Only applies to the `POST` form of this API.
  64. `master_timeout`::
  65. (Optional, <<time-units, time units>>) Defines how long to wait while trying to
  66. route the request to the current master node in the cluster. Defaults to `30s`.
  67. Applies to both `POST` and `DELETE` forms of this API.
  68. `wait_for_removal`::
  69. (Optional, Boolean) Specifies whether to wait for all excluded nodes to be
  70. removed from the cluster before clearing the voting configuration exclusions
  71. list. Defaults to `true`, meaning that all excluded nodes must be removed from
  72. the cluster before this API takes any action. If set to `false` then the voting
  73. configuration exclusions list is cleared even if some excluded nodes are still
  74. in the cluster. Only applies to the `DELETE` form of this API.
  75. [[voting-config-exclusions-api-example]]
  76. ==== {api-examples-title}
  77. Adds nodes named `nodeName1` and `nodeName2` to the voting configuration
  78. exclusions list:
  79. [source,console]
  80. --------------------------------------------------
  81. POST /_cluster/voting_config_exclusions?node_names=nodeName1,nodeName2
  82. --------------------------------------------------
  83. Remove all exclusions from the list:
  84. [source,console]
  85. --------------------------------------------------
  86. DELETE /_cluster/voting_config_exclusions
  87. --------------------------------------------------