voting-exclusions.asciidoc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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`. Only applies
  44. to the `POST` form of this API.
  45. `node_ids`::
  46. A comma-separated list of the persistent ids of the nodes to exclude from the
  47. voting configuration. If specified, you may not also specify `?node_names`.
  48. Only applies to the `POST` form of this API.
  49. `timeout`::
  50. (Optional, <<time-units, time units>>) When adding a voting configuration
  51. exclusion, the API waits for the specified nodes to be excluded from the voting
  52. configuration before returning. The period of time to wait is specified by the
  53. `?timeout` query parameter. If the timeout expires before the appropriate
  54. condition is satisfied, the request fails and returns an error. Defaults to
  55. `30s`. Only applies to the `POST` form of this API.
  56. `master_timeout`::
  57. (Optional, <<time-units, time units>>) Defines how long to wait while trying to
  58. route the request to the current master node in the cluster. Defaults to `30s`.
  59. Applies to both `POST` and `DELETE` forms of this API.
  60. `wait_for_removal`::
  61. (Optional, Boolean) Specifies whether to wait for all excluded nodes to be
  62. removed from the cluster before clearing the voting configuration exclusions
  63. list. Defaults to `true`, meaning that all excluded nodes must be removed from
  64. the cluster before this API takes any action. If set to `false` then the voting
  65. configuration exclusions list is cleared even if some excluded nodes are still
  66. in the cluster. Only applies to the `DELETE` form of this API.
  67. [[voting-config-exclusions-api-example]]
  68. ==== {api-examples-title}
  69. Adds nodes named `nodeName1` and `nodeName2` to the voting configuration
  70. exclusions list:
  71. [source,console]
  72. --------------------------------------------------
  73. POST /_cluster/voting_config_exclusions?node_names=nodeName1,nodeName2
  74. --------------------------------------------------
  75. Remove all exclusions from the list:
  76. [source,console]
  77. --------------------------------------------------
  78. DELETE /_cluster/voting_config_exclusions
  79. --------------------------------------------------