Skip to content

Commit 0783f97

Browse files
isaacmbrownmattpollarddavidjarzebowskirachaelrenkanother-mattr
authored
[GHES 3.12] Document ghe-remove-node (#49210)
Co-authored-by: Matt Pollard <[email protected]> Co-authored-by: David Jarzebowski <[email protected]> Co-authored-by: Rachael Rose Renk <[email protected]> Co-authored-by: Matt Reyes <[email protected]>
1 parent 1087240 commit 0783f97

File tree

5 files changed

+152
-5
lines changed

5 files changed

+152
-5
lines changed

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,41 @@ $ ghe-cluster-maintenance -u
664664
# Unsets maintenance mode
665665
```
666666

667+
{% ifversion cluster-node-removal %}
668+
669+
### ghe-remove-node
670+
671+
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-managing-and-updating-your-instance/configuring-clustering/replacing-a-cluster-node)."
672+
673+
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-managing-and-updating-your-instance/configuring-clustering/initializing-the-cluster#about-the-cluster-configuration-file)."
674+
675+
```shell
676+
ghe-remove-node HOSTNAME
677+
```
678+
679+
The command does the following things:
680+
- Evacuates data from any data services running on the node, so that the remaining nodes in your cluster contain copies of the data
681+
- 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
682+
683+
You can run the command with the following flags.
684+
685+
Flag | Description
686+
---- | ----------
687+
`-ne/--no-evacuate` | Skips evacuation of data services (warning: may result in data loss).
688+
`-v/--verbose` | Prints additional information to the console.
689+
`-h/--help` | Displays help text for the command.
690+
691+
{% note %}
692+
693+
**Notes:**
694+
695+
- 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.
696+
- 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.
697+
698+
{% endnote %}
699+
700+
{% endif %}
701+
667702
### ghe-cluster-status
668703

669704
Check the health of your nodes and services in a cluster deployment of {% data variables.product.prodname_ghe_server %}.

content/admin/monitoring-managing-and-updating-your-instance/configuring-clustering/evacuating-a-cluster-node-running-data-services.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ redirect_from:
1010
- /admin/enterprise-management/configuring-clustering/evacuating-a-cluster-node
1111
- /admin/enterprise-management/configuring-clustering/evacuating-a-cluster-node-running-data-services
1212
versions:
13-
ghes: '*'
13+
ghes: '<=3.11'
1414
type: how_to
1515
topics:
1616
- Clustering

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

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,120 @@ You can replace an existing, functional node in your cluster. For example, you m
3636

3737
To replace a functional node, install the {% data variables.product.product_name %} 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.
3838

39+
{% note %}
40+
41+
**Note:** If you're replacing the primary MySQL node, see "[Replacing the primary MySQL node](#replacing-the-primary-mysql-node)."
42+
43+
{% endnote %}
44+
3945
{% data reusables.enterprise_clustering.replacing-a-cluster-node-provision %}
4046
{% data reusables.enterprise_clustering.replacing-a-cluster-node-admin-configure-ip %}
4147
{% data reusables.enterprise_clustering.replacing-a-cluster-node-modify-cluster-conf %}
4248
{% data reusables.enterprise_clustering.replacing-a-cluster-node-initialize-new-node %}
4349
{% data reusables.enterprise_clustering.replacing-a-cluster-node-config-node %}
50+
{% ifversion cluster-node-removal %}
51+
1. To take the node you're replacing offline, from the primary MySQL node of your cluster, run the following command.
52+
53+
```shell
54+
ghe-remove-node NODE-HOSTNAME
55+
```
56+
57+
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)."
58+
{% else %}
4459
{% data reusables.enterprise_clustering.replacing-a-cluster-node-need-three-nodes %}
4560
{% data reusables.enterprise_clustering.replacing-a-cluster-node-mark-offline %}
4661
{% data reusables.enterprise_clustering.replacing-a-cluster-node-validate-config %}
47-
{% data reusables.enterprise_clustering.replacing-a-cluster-node-replacement-name %}
62+
{% endif %}
4863

4964
## Replacing a node in an emergency
5065

5166
You can replace a failed node in your cluster. For example, a software or hardware issue may affect a node's availability.
5267

68+
{% note %}
69+
70+
**Note:** If you're replacing the primary MySQL node, see "[Replacing the primary MySQL node](#replacing-the-primary-mysql-node)."
71+
72+
{% endnote %}
73+
74+
{% ifversion cluster-node-removal %}
75+
76+
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.
77+
78+
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.
79+
80+
```shell
81+
ghe-remove-node --no-evacuate NODE-HOSTNAME
82+
```
83+
84+
This command will mark the node as offline in your configuration and stop traffic being routed to the node. You can run this command in `no-evacuate` mode now because, later in this procedure, you'll run commands that instruct data services on the node to copy any replicas onto the other available nodes in the cluster. For more information, see "[AUTOTITLE](/admin/administering-your-instance/administering-your-instance-from-the-command-line/command-line-utilities#ghe-remove-node)."
85+
1. Add your replacement node to the cluster.
86+
{% data reusables.enterprise_clustering.replacing-a-cluster-node-provision %}
87+
{% data reusables.enterprise_clustering.replacing-a-cluster-node-admin-configure-ip %}
88+
1. To add the newly provisioned replacement node, on any node, modify the `cluster.conf` file to add the replacement node. For example, this modified `cluster.conf` file adds the newly provisioned node `ghe-replacement-data-node-3`:
89+
90+
<pre>
91+
[cluster "<em>ghe-replacement-data-node-3</em>"]
92+
hostname = <em>ghe-replacement-data-node-3</em>
93+
ipv4 = <em>192.168.0.7</em>
94+
# ipv6 = fd12:3456:789a:1::7
95+
git-server = true
96+
pages-server = true
97+
mysql-server = true
98+
elasticsearch-server = true
99+
redis-server = true
100+
memcache-server = true
101+
metrics-server = true
102+
storage-server = true
103+
</pre>
104+
105+
{% data reusables.enterprise_clustering.replacing-a-cluster-node-initialize-new-node %}
106+
{% data reusables.enterprise_clustering.replacing-a-cluster-node-config-node %}
107+
1. Remove references to data services on the node you removed.
108+
1. Find the UUID of the node you removed. To find the UUID, run the following command, replacing `HOSTNAME` with the hostname of the node. You will use this UUID in the next step.
109+
110+
```shell
111+
ghe-config cluster.HOSTNAME.uuid
112+
```
113+
114+
1. To remove references to data services, run the following commands. Replace `UUID` with the UUID of the node.
115+
116+
These commands indicate to each service that the node is permanently removed. The services will recreate any replicas contained within the node on the available nodes within the cluster.
117+
118+
{% note %}
119+
120+
**Note:** These commands may cause increased load on the server while data is rebalanced across replicas.
121+
122+
{% endnote %}
123+
124+
For the `git-server` service (used for repository data):
125+
126+
```shell
127+
ghe-spokesctl server destroy git-server-UUID
128+
```
129+
130+
For the `pages-server` service (used for {% data variables.product.prodname_pages %} site builds):
131+
132+
```shell
133+
ghe-dpages remove pages-server-UUID
134+
```
135+
136+
For the `storage-server` service (used for Git LFS data, avatar images, file attachments, and release archives):
137+
138+
```shell
139+
ghe-storage destroy-host storage-server-UUID --force
140+
```
141+
142+
1. Optionally, delete the entry for the removed node in your `cluster.conf` file. Doing so will keep your `cluster.conf` file organized and save time during future `config-apply` runs.
143+
1. To remove the entry from the file, run the following command, replacing `HOSTNAME` with the hostname of the removed node.
144+
145+
```shell
146+
ghe-config --remove-section "cluster.HOSTNAME"
147+
```
148+
149+
1. To copy the configuration to other nodes in the cluster, from the administrative shell of the node where you modified `cluster.conf`, run `ghe-cluster-config-apply`.
150+
151+
{% else %}
152+
53153
To replace a node in an emergency, install the {% data variables.product.product_name %} appliance on a new VM, configure an IP address, take the failed node offline, apply the configuration, add the new node to the cluster configuration file, initialize the cluster and apply the configuration, and optionally, evacuate the failed node.
54154

55155
{% data reusables.enterprise_clustering.replacing-a-cluster-node-provision %}
@@ -62,6 +162,8 @@ To replace a node in an emergency, install the {% data variables.product.product
62162
{% data reusables.enterprise_clustering.replacing-a-cluster-node-config-node %}
63163
{% data reusables.enterprise_clustering.replacing-a-cluster-node-need-three-nodes %}
64164

165+
{% endif %}
166+
65167
## Replacing the primary MySQL node
66168

67169
To provide database services, your cluster requires a primary MySQL node and at least one secondary MySQL node. For more information, see "[AUTOTITLE](/admin/monitoring-managing-and-updating-your-instance/configuring-clustering/about-cluster-nodes)."
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Issue #12966
2+
# ghe-remove-node command line utility
3+
4+
versions:
5+
ghes: '>=3.12'
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
1. If you're replacing the primary MySQL or Redis node, in `cluster.conf`, modify the `mysql-master` or `redis-master` value with the replacement node name.
1+
1. If you're replacing the primary Redis node, in `cluster.conf`, modify the `redis-master` value with the replacement node name.
22

3-
For example, this modified `cluster.conf` file specifies a newly provisioned cluster node, `ghe-replacement-data-node-1` as the primary MySQL and Redis node:
3+
{% note %}
4+
5+
**Note:** If your primary Redis node is also your primary MySQL node, see "[Replacing the primary MySQL node](#replacing-the-primary-mysql-node)."
6+
7+
{% endnote %}
8+
9+
For example, this modified `cluster.conf` file specifies a newly provisioned cluster node, `ghe-replacement-data-node-1` as the primary Redis node:
410

511
<pre>
6-
mysql-master = <em>ghe-replacement-data-node-1</em>
712
redis-master = <em>ghe-replacement-data-node-1</em>
813
</pre>

0 commit comments

Comments
 (0)