State Storage Move
If you need to decommission a YDB cluster host that contains part of State Storage, you need to move it to another host.
Warning
Errors in metadata subsystem configuration (including the domains_config section) or an incorrect sequence of changes can lead to YDB cluster unavailability.
As an example, consider a YDB cluster with the following State Storage configuration:
...
domains_config:
...
state_storage:
- ring:
node: [1, 2, 3, 4, 5, 6, 7, 8, 9]
nto_select: 9
ssid: 1
...
...
On the host with node_id:1, a cluster static node is configured and running, which serves part of State Storage. Suppose we need to decommission this host.
To replace node_id:1, we added a new host with node_id:10 to the cluster and deployed a static node on it.
To move State Storage from host node_id:1 to node_id:10:
-
Stop the cluster static nodes on hosts with
node_id:1andnode_id:10.Note
A YDB cluster is fault-tolerant. Temporary node shutdown does not lead to cluster unavailability. For more details, see YDB Cluster Topology.
-
In the configuration file
config.yaml, change thenodehost list, replacing the identifier of the host being removed with the identifier of the host being added:domains_config: ... state_storage: - ring: node: [2, 3, 4, 5, 6, 7, 8, 9, 10] nto_select: 9 ssid: 1 ... -
Update the configuration files
config.yamlfor all cluster nodes, including dynamic ones. -
Using the rolling-restart procedure, restart all cluster nodes, including dynamic ones, except for static nodes on hosts with
node_id:1andnode_id:10. Note that a delay of at least 15 seconds is required between host restarts. -
Start the cluster static nodes on hosts
node_id:1andnode_id:10.