State Storage Move
Article under development
Tip
New YDB clusters are recommended to be deployed using configuration V2. If a cluster was deployed using configuration V1, it will still use it after updating to YDB version 25.1 or higher. After such an update, it is recommended to plan and perform migration to V2, because support for V1 will be discontinued in future versions of YDB. For the instructions on how to determine the configuration version of the cluster, see Checking Configuration Version.
If you need to decommission a YDB cluster node that contains part of State Storage, you need to move it to another node.
Warning
Incorrect sequence of actions or configuration errors can lead to YDB cluster unavailability.
When using Configuration V2, State Storage configuration is performed automatically. To make changes to the configuration, you need to perform the following actions: stop automatic State Storage configuration management, get the current State Storage configuration, change the current configuration in the desired way and specify it explicitly as the target, then apply it, ensure it is applied, perform node decommissioning, remove explicit State Storage configuration specification and enable automatic State Storage configuration.
As an example, consider a YDB cluster where node 1 is part of State Storage, and node 10 is not, and we will assume that the goal of changing the State Storage configuration is to decommission node 1.
-
Stop automatic State Storage configuration management
-
Get the current State Storage configuration
-
Change the current configuration in the desired way and specify it explicitly as the target
Suppose the following State Storage configuration is obtained:
... state_storage: - ring: node: [1, 2, 3, 4, 5, 6, 7, 8, 9] nto_select: 9 ssid: 1 ...
A static node is configured and running on the host with
node_id:1
, which is a part of State Storage. Suppose we need to decommission this host.To replace
node_id:1
, we use another host with a static node deployed on it withnode_id:10
.To move State Storage from node
node_id:1
tonode_id:10
, in the configuration fileconfig.yaml
change thenode
host list, replacing the identifier of the node to be removed with the identifier of the node to be added:... state_storage: - ring: node: [10, 2, 3, 4, 5, 6, 7, 8, 9] nto_select: 9 ssid: 1 ...
-
Apply the configuration.
-
Ensure the configuration is applied.
Note that the full application of new State Storage nodes after reconfiguration occurs with a delay of at least 15 seconds. -
Perform node decommissioning.
-
Remove explicit State Storage configuration specification.
-
Enable automatic State Storage configuration.