Skip to content

Commit 827f4cb

Browse files
Correct HA stateless node removal guidance (#62264)
Co-authored-by: Andrey Bazhutkin <andrba@github.com>
1 parent 2c2e3b8 commit 827f4cb

4 files changed

Lines changed: 50 additions & 17 deletions

File tree

content/admin/administering-your-instance/administering-your-instance-from-the-command-line/command-line-utilities.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,27 +1159,32 @@ ghe-dpages evacuate pages-server-UUID
11591159
11601160
### ghe-remove-node
11611161
1162-
This utility removes a node from a cluster. If you're replacing a node, after you've set up a replacement node, you can use this command to take the old node offline. For more information, see [AUTOTITLE](/admin/monitoring-and-managing-your-instance/configuring-clustering/replacing-a-cluster-node).
1162+
This utility removes a node from a cluster{% ifversion ghes > 3.17 %} or an additional node from a high availability (HA) configuration{% endif %}. For a planned replacement of a functional cluster node, set up the replacement node before using this command to remove the old node. For more information, see [AUTOTITLE](/admin/monitoring-and-managing-your-instance/configuring-clustering/replacing-a-cluster-node#replacing-a-functional-node).{% ifversion ghes > 3.17 %} For the required HA checks and verification steps, see [Removing an additional node](/admin/monitoring-and-managing-your-instance/additional-nodes/configuring-additional-nodes#removing-an-additional-node).{% endif %}
11631163
1164-
You must run this command from the primary MySQL node in your cluster, which is typically the node designated as `mysql-master` in your cluster configuration file (`cluster.conf`). You can use this command to remove any node, with the exception of the `mysql-master` or `redis-master` node. For more information, see [AUTOTITLE](/admin/monitoring-and-managing-your-instance/configuring-clustering/initializing-the-cluster#about-the-cluster-configuration-file).
1164+
Before using this command for a planned removal, install the latest patch release for your feature release on every node. Every node must run the same exact release. Wait for any upgrade or configuration run to finish before starting removal. For emergency replacement of an unavailable cluster node, see [AUTOTITLE](/admin/monitoring-and-managing-your-instance/configuring-clustering/replacing-a-cluster-node#replacing-a-node-in-an-emergency).
1165+
1166+
You must run this command from the primary MySQL node, which is typically the node designated as `mysql-master` in the cluster configuration file (`cluster.conf`).{% ifversion ghes > 3.17 %} In an HA configuration, run the command from the HA primary.{% endif %} You cannot remove the `mysql-master` or `redis-master` node. For more information, see [AUTOTITLE](/admin/monitoring-and-managing-your-instance/configuring-clustering/initializing-the-cluster#about-the-cluster-configuration-file).
11651167
11661168
```shell
11671169
ghe-remove-node HOSTNAME
11681170
```
11691171
11701172
The command does the following things:
1171-
* Evacuates data from any data services running on the node, so that the remaining nodes in your cluster contain copies of the data
1172-
* Marks the node as offline in your configuration, applies this change to the rest of the nodes in the cluster, and stops traffic being routed to the node
1173+
1174+
* Evacuates data from any data services running on the node, so that the remaining nodes contain copies of the data
1175+
* Drains workloads from the node
1176+
* Removes the node from the configuration.{% ifversion ghes > 3.17 %} If another non-primary node remains, the command runs `ghe-config-apply` and stops routing traffic to the removed node. If no non-primary node remains, the command removes cluster metadata and converts the primary to a standalone instance without running `ghe-config-apply`.{% else %} The command runs `ghe-config-apply` and stops routing traffic to the removed node.{% endif %}
11731177
11741178
You can run the command with the following flags.
11751179
11761180
Flag | Description
11771181
---- | ----------
1178-
`-ne/--no-evacuate` | Skips evacuation of data services (warning: may result in data loss).
1182+
`-ne/--no-evacuate` | Marks the node offline in the configuration instead of removing it, and skips evacuation of data services (warning: may result in data loss).
11791183
`-v/--verbose` | Prints additional information to the console.
11801184
11811185
> [!NOTE]
1182-
> * This command can only be used to remove a node from a cluster configuration. It cannot be used to remove a node from a high availability configuration.
1186+
> {% ifversion ghes > 3.17 %}* In an HA configuration, you can use this command to remove an additional node. You cannot use it to remove the HA primary or a replica.{% endif %}
1187+
> * The target node must report `ready` in `nomad node status` to complete removal. The `--no-evacuate` flag does not remove an offline node from the configuration.
11831188
> * This command does not support parallel execution. To remove multiple nodes, you must wait until this command has finished before running it for another node.
11841189
11851190
### ghe-spokesctl

content/admin/monitoring-and-managing-your-instance/additional-nodes/configuring-additional-nodes.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,39 @@ We recommend a maintenance window to add stateless nodes.
6464

6565
## Removing an additional node
6666

67-
To remove a node, run `ghe-remove-node` from the node you want to remove. Then, on the primary node, you must run:
67+
Before removing an additional node, install the same latest patch for your feature release on every node in the HA deployment and schedule a maintenance window. Wait for any upgrade or configuration run to finish before starting removal.
6868

69-
``` shell copy
70-
ghe-config-apply
71-
```
69+
1. On the HA primary, check the status of every node in the HA deployment.
70+
71+
```shell copy
72+
ghe-cluster-nodes
73+
ghe-cluster-nodes --offline
74+
nomad node status
75+
ghe-cluster-status --extended --verbose
76+
```
77+
78+
Confirm that both `ghe-cluster-nodes` commands list the same hostnames and include the hostname of the node you plan to remove. Confirm that every node has a Nomad status of `ready`, and `connect-ssh` and `enterprise-version` are `ok` for every node. Confirm that stateful services on the primary and any replicas are healthy. If no replica remains, a warning that no MySQL replica was found is expected. Failures limited to web, job, or memcache workloads on the target do not block removal. If any other node-level or stateful-service check fails, contact {% data variables.contact.github_support %} before removal.
79+
80+
1. On the HA primary, remove the additional node. Replace `HOSTNAME` with the hostname of the additional node.
81+
82+
```shell copy
83+
ghe-remove-node --verbose HOSTNAME
84+
```
85+
86+
If another non-primary node remains, the command drains the target, removes it from the HA configuration, and runs `ghe-config-apply`. If no non-primary node remains, the command removes the cluster metadata and converts the primary to a standalone instance without running `ghe-config-apply`. Do not run `ghe-config-apply` separately in either case.
87+
88+
1. Verify the removal.
89+
90+
If another non-primary node remains, run the following commands on the HA primary. Confirm that the hostname is absent and that the HA configuration is healthy.
91+
92+
```shell copy
93+
ghe-cluster-nodes --offline
94+
ghe-cluster-status --extended --verbose
95+
```
7296

73-
The `ghe-config-apply` command is a requirement to remove stateless nodes.
97+
If no non-primary node remains, do not run the cluster-only commands. Confirm that the removal output contains `Cluster artifacts removed; now standalone.`, then confirm that the primary serves user traffic and processes web and job workloads.
7498

75-
We recommend a maintenance window to remove stateless nodes.
99+
If an additional node is offline, unreachable, or on a different version, or if `ghe-remove-node` or a verification check fails, contact {% data variables.contact.github_support %}. Do not edit `cluster.conf` manually.
76100

77101
## Reprovisioning a node that previously hosted {% data variables.product.prodname_ghe_server %}
78102

content/admin/monitoring-and-managing-your-instance/configuring-clustering/replacing-a-cluster-node.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Replacing a cluster node
3-
intro: If a node fails in a {% data variables.product.prodname_ghe_server %} cluster, or if you want to add a new node with more resources, mark any nodes to replace as offline, then add the new node.
3+
intro: Replace a functional or failed node in a {% data variables.product.prodname_ghe_server %} cluster while preserving the services that the node provides.
44
product: '{% data reusables.gated-features.cluster %}'
55
redirect_from:
66
- /enterprise/admin/clustering/replacing-a-cluster-node
@@ -28,7 +28,9 @@ After you replace a node, {% data variables.location.product_location %} does no
2828

2929
You can replace an existing, functional node in your cluster. For example, you may want to provide a virtual machine (VM) with additional CPU, memory, or storage resources.
3030

31-
To replace a functional node, install the {% data variables.product.prodname_ghe_server %} appliance on a new VM, configure an IP address, add the new node to the cluster configuration file, initialize the cluster and apply the configuration, then take the node you replaced offline.
31+
To replace a functional node, install the {% data variables.product.prodname_ghe_server %} appliance on a new VM, configure an IP address, add the new node to the cluster configuration file, initialize the cluster and apply the configuration, then remove the node you replaced.
32+
33+
Before starting the replacement, install the latest patch release for your feature release on every cluster node, including the replacement node. Every node must run the same exact release. Wait for any upgrade or configuration run to finish before starting replacement.
3234

3335
> [!NOTE]
3436
> If you're replacing the primary database node, see [Replacing the primary database node](#replacing-the-primary-database-node-mysql-or-mysql-and-mssql).
@@ -38,13 +40,13 @@ To replace a functional node, install the {% data variables.product.prodname_ghe
3840
{% data reusables.enterprise_clustering.replacing-a-cluster-node-modify-cluster-conf %}
3941
{% data reusables.enterprise_clustering.replacing-a-cluster-node-initialize-new-node %}
4042
{% data reusables.enterprise_clustering.replacing-a-cluster-node-config-node %}
41-
1. To take the node you're replacing offline, from the primary MySQL node of your cluster, run the following command.
43+
1. To remove the node you're replacing, from the primary MySQL node of your cluster, run the following command.
4244

4345
```shell
4446
ghe-remove-node NODE-HOSTNAME
4547
```
4648

47-
This command will evacuate data from any data services running on the node, mark the node as offline in your configuration, and stop traffic being routed to the node. For more information, see [AUTOTITLE](/admin/administering-your-instance/administering-your-instance-from-the-command-line/command-line-utilities#ghe-remove-node).
49+
This command evacuates data from any data services running on the node, drains its workloads, removes the node from the cluster configuration, applies the change, and stops traffic from being routed to the node. For more information, see [AUTOTITLE](/admin/administering-your-instance/administering-your-instance-from-the-command-line/command-line-utilities#ghe-remove-node).
4850

4951
## Replacing a node in an emergency
5052

@@ -55,6 +57,8 @@ You can replace a failed node in your cluster. For example, a software or hardwa
5557
5658
To replace a node in an emergency, you'll take the failed node offline, add your replacement node to the cluster, then run commands to remove references to data services on the removed node.
5759

60+
Before starting the replacement, confirm that every available node that will remain in the cluster already runs the latest patch release for your feature release. Install that exact release on the replacement node. If the remaining nodes are not already on that release, contact {% data variables.contact.github_support %} before continuing. Wait for any active upgrade or configuration run to finish.
61+
5862
1. To remove the node that is experiencing issues from the cluster, from the primary MySQL node of your cluster, run the following command. Replace NODE-HOSTNAME with the hostname of the node you're taking offline.
5963

6064
```shell

data/reusables/enterprise_clustering/replacing-a-cluster-node-modify-cluster-conf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1. To add the newly provisioned replacement node, on any node, modify the `cluster.conf` file to remove the failed node and add the replacement node. For example, this modified `cluster.conf` file replaces `ghe-data-node-3` with the newly provisioned node, `ghe-replacement-data-node-3`:
1+
1. To add the newly provisioned replacement node, on any node, modify the `cluster.conf` file to add the replacement node. Keep the node you're replacing in `cluster.conf` until you run `ghe-remove-node` later in this procedure. For example, this modified `cluster.conf` file adds the newly provisioned node, `ghe-replacement-data-node-3`:
22

33
<pre>
44
[cluster "<em>ghe-replacement-data-node-3</em>"]

0 commit comments

Comments
 (0)