From a9b261150a9264110d52c95b31623f94e8c85b76 Mon Sep 17 00:00:00 2001 From: Anton Rubin Date: Mon, 30 Jun 2025 10:18:28 +0100 Subject: [PATCH 1/5] adding voting_configuration_exclusion-api-docs Signed-off-by: Anton Rubin --- ...cluster-voting-configuration-exclusions.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 _api-reference/cluster-api/cluster-voting-configuration-exclusions.md diff --git a/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md b/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md new file mode 100644 index 0000000000..51915be6d3 --- /dev/null +++ b/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md @@ -0,0 +1,98 @@ +--- +layout: default +title: Voting configuration exclusions +parent: Cluster APIs +nav_order: 75 +--- + +# Adding voting configuration exclusions + +The `_cluster/voting_config_exclusions` API allows you to exclude one or more nodes from the voting configuration. This is useful for safely removing master eligible nodes from the cluster or forcing a new re-election of cluster manager. + + +## Endpoints +```json +POST /_cluster/voting_config_exclusions +``` + + + +## Query parameters + +The following table lists the available query parameters. All query parameters are optional. + +| Parameter | Data type | Description | +|:-------------|:---------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `node_ids` | List or String | A comma-separated list of node IDs to exclude from the voting configuration. When using this setting, you cannot also specify `node_names`. Either `node_ids` or `node_names` are required to receive a valid response. | +| `node_names` | List or String | A comma-separated list of node names to exclude from the voting configuration. When using this setting, you cannot also specify `node_ids`. Either `node_ids` or `node_names` are required to receive a valid response. | +| `timeout` | String | When adding a voting configuration exclusion, the API waits for the specified nodes to be excluded from the voting configuration before returning a response. If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error. | + + + +## Example + +Exclude a node named `opensearch-node1` from the voting configuration: + +```json +POST /_cluster/voting_config_exclusions?node_names=opensearch-node1 +``` +{% include copy-curl.html %} + +You can also specify node IDs instead: + +```json +POST /_cluster/voting_config_exclusions?node_ids=UfVnWzDoT4mYtjb6CZsGvw +``` +{% include copy-curl.html %} + +# Removing voting configuration exclusions + +Use the `_cluster/voting_config_exclusions` DELETE API to clear the list of nodes that were previously excluded from the voting configuration. This is typically used after excluded nodes have been safely removed or replaced. You can optionally wait for the nodes to be removed from the cluster before clearing the exclusions. + + +## Endpoints +```json +DELETE /_cluster/voting_config_exclusions +``` + + + +## Query parameters + +The following table lists the available query parameters. All query parameters are optional. + +| Parameter | Data type | Description | +|:-------------------|:----------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `wait_for_removal` | Boolean | Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. When `true`, all excluded nodes are removed from the cluster before this API takes any action. When `false`, the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster. _(Default: `true`)_ | + + + +## Example + +Use the following command to remove all voting configuration exclusions without waiting for nodes to be removed: + +```json +DELETE /_cluster/voting_config_exclusions?wait_for_removal=false +``` +{% include copy-curl.html %} + From 7d51e3856eacefcefa57f0d2425017a9506a7fee Mon Sep 17 00:00:00 2001 From: AntonEliatra Date: Mon, 30 Jun 2025 11:19:46 +0100 Subject: [PATCH 2/5] Update cluster-voting-configuration-exclusions.md Signed-off-by: AntonEliatra --- .../cluster-api/cluster-voting-configuration-exclusions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md b/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md index 51915be6d3..af2226de57 100644 --- a/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md +++ b/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md @@ -7,7 +7,7 @@ nav_order: 75 # Adding voting configuration exclusions -The `_cluster/voting_config_exclusions` API allows you to exclude one or more nodes from the voting configuration. This is useful for safely removing master eligible nodes from the cluster or forcing a new re-election of cluster manager. +The `_cluster/voting_config_exclusions` API allows you to exclude one or more nodes from the voting configuration. This is useful when you want to safely remove cluster manager eligible nodes from the cluster or to change the current cluster manager. ## Endpoints + ```json DELETE /_cluster/voting_config_exclusions ``` @@ -89,7 +95,7 @@ The following table lists the available query parameters. All query parameters a ## Example -Use the following command to remove all voting configuration exclusions without waiting for nodes to be removed: +Use the following request to remove all voting configuration exclusions without waiting for nodes to be removed: ```json DELETE /_cluster/voting_config_exclusions?wait_for_removal=false From 4c76a1f55a61ad5f96e5f695ab196beb2505f0ef Mon Sep 17 00:00:00 2001 From: AntonEliatra Date: Mon, 30 Jun 2025 19:40:22 +0100 Subject: [PATCH 4/5] Update cluster-voting-configuration-exclusions.md Signed-off-by: AntonEliatra --- .../cluster-api/cluster-voting-configuration-exclusions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md b/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md index 4f2c595fc9..d909149a6e 100644 --- a/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md +++ b/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md @@ -56,7 +56,7 @@ POST /_cluster/voting_config_exclusions?node_names=opensearch-node1 Alternatively, you can specify the node IDs as a comma-separated list: ```json -POST /_cluster/voting_config_exclusions?node_ids=UfVnWzDoT4mYtjb6CZsGvw +POST /_cluster/voting_config_exclusions?node_ids=6ITS4DmNR7OJT1G5lyW8Lw,PEEW2S7-Su2XCA4zUE9_2Q ``` {% include copy-curl.html %} From 392a407dba4f09b3eaddd195fb40dbda81e05c0a Mon Sep 17 00:00:00 2001 From: Nathan Bower Date: Tue, 1 Jul 2025 11:47:20 -0400 Subject: [PATCH 5/5] Apply suggestions from code review Signed-off-by: Nathan Bower --- .../cluster-api/cluster-voting-configuration-exclusions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md b/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md index d909149a6e..80ce809f06 100644 --- a/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md +++ b/_api-reference/cluster-api/cluster-voting-configuration-exclusions.md @@ -38,8 +38,8 @@ The following table lists the available query parameters. All query parameters a | Parameter | Data type | Description | |:-------------|:---------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `node_ids` | List or String | A comma-separated list of node IDs to exclude from the voting configuration. When using this setting, you cannot also specify `node_names`. Either `node_ids` or `node_names` are required to receive a valid response. | -| `node_names` | List or String | A comma-separated list of node names to exclude from the voting configuration. When using this setting, you cannot also specify `node_ids`. Either `node_ids` or `node_names` are required to receive a valid response. | +| `node_ids` | List or String | A comma-separated list of node IDs to exclude from the voting configuration. When using this setting, you cannot also specify `node_names`. Either `node_ids` or `node_names` is required in order to receive a valid response. | +| `node_names` | List or String | A comma-separated list of node names to exclude from the voting configuration. When using this setting, you cannot also specify `node_ids`. Either `node_ids` or `node_names` is required in order to receive a valid response. | | `timeout` | String | When adding a voting configuration exclusion, the API waits for the specified nodes to be excluded from the voting configuration before returning a response. If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error. | @@ -89,7 +89,7 @@ The following table lists the available query parameters. All query parameters a | Parameter | Data type | Description | |:-------------------|:----------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `wait_for_removal` | Boolean | Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. When `true`, all excluded nodes are removed from the cluster before this API takes any action. When `false`, the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster. _(Default: `true`)_ | +| `wait_for_removal` | Boolean | Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. When `true`, all excluded nodes are removed from the cluster before this API takes any action. When `false`, the voting configuration exclusions list is cleared even if some excluded nodes are still present in the cluster. _(Default: `true`)_ |