You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/admin/administering-your-instance/administering-your-instance-from-the-command-line/command-line-utilities.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -664,6 +664,41 @@ $ ghe-cluster-maintenance -u
664
664
# Unsets maintenance mode
665
665
```
666
666
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
+
667
702
### ghe-cluster-status
668
703
669
704
Check the health of your nodes and services in a cluster deployment of {% data variables.product.prodname_ghe_server %}.
Copy file name to clipboardExpand all lines: content/admin/monitoring-managing-and-updating-your-instance/configuring-clustering/evacuating-a-cluster-node-running-data-services.md
Copy file name to clipboardExpand all lines: content/admin/monitoring-managing-and-updating-your-instance/configuring-clustering/replacing-a-cluster-node.md
+103-1Lines changed: 103 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,20 +36,120 @@ You can replace an existing, functional node in your cluster. For example, you m
36
36
37
37
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.
38
38
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
+
39
45
{% data reusables.enterprise_clustering.replacing-a-cluster-node-provision %}
40
46
{% data reusables.enterprise_clustering.replacing-a-cluster-node-admin-configure-ip %}
41
47
{% data reusables.enterprise_clustering.replacing-a-cluster-node-modify-cluster-conf %}
42
48
{% data reusables.enterprise_clustering.replacing-a-cluster-node-initialize-new-node %}
43
49
{% 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 %}
44
59
{% data reusables.enterprise_clustering.replacing-a-cluster-node-need-three-nodes %}
45
60
{% data reusables.enterprise_clustering.replacing-a-cluster-node-mark-offline %}
46
61
{% data reusables.enterprise_clustering.replacing-a-cluster-node-validate-config %}
47
-
{% data reusables.enterprise_clustering.replacing-a-cluster-node-replacement-name %}
62
+
{% endif %}
48
63
49
64
## Replacing a node in an emergency
50
65
51
66
You can replace a failed node in your cluster. For example, a software or hardware issue may affect a node's availability.
52
67
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):
1. Optionally, delete the entry forthe removed nodein 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
+
53
153
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.
54
154
55
155
{% 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
62
162
{% data reusables.enterprise_clustering.replacing-a-cluster-node-config-node %}
63
163
{% data reusables.enterprise_clustering.replacing-a-cluster-node-need-three-nodes %}
64
164
165
+
{% endif %}
166
+
65
167
## Replacing the primary MySQL node
66
168
67
169
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)."
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.
2
2
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:
0 commit comments