The process of renaming a region requires a few addition steps beyond simply changing the name in the web administrator. This is because we use this to target our key/value store on the nodes, and so that will need to be updated manually.
SECTIONS
SSH into each node and run: systemctl stop cs-agent
You will need to determine the current cluster leader before proceeding. To do so, on one of the nodes run consul info. Under the consul section, you will see the leader.
# On all nodes, except the leader, run the following
consul leave
systemctl stop consul
Verify all members have been evicted by running consul members on the leader node.
# Evict The Leader
consul leave
systemctl stop consul
On each node, update the datacenter name to match the name of the new region:
<aside> 🚨 The datacenter name should be one word, all lower case.
</aside>
sed -i 's/"datacenter":.*/"datacenter":"NEW-NAME",/g' /etc/consul/config.json
On the leader node, bring up consul with systemctl start consul.
<aside>
💡 Use consul monitor and consul info to ensure that no errors exist.
</aside>
Upon successful boot, run that same command across all nodes in your cluster
Verify all members have joined with consul members
Finally, run systemctl start cs-agent on all nodes in the cluster.