Moving a State Storage

To decommission a YDB cluster host that accommodates a part of a State Storage, you need to move the group to another host.

Warning

The YDB cluster might become unavailable as a result of an invalid sequence of actions or a configuration error.

As an example, let's take 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
  ...
...

The static node of the cluster that serves a part of State Storage is set up and running on the host with node_id:1. Suppose that you want to decommission this host.

To replace node_id:1, we added to the cluster a new host with node_id:10 and deployed a static node in it.

To move State Storage from the node_id:1 host to the node_id:10 host:

  1. Stop the cluster's static nodes on the hosts with node_id:1 and node_id:10.

    Note

    YDB cluster is fault tolerant. Temporarily shutting down a node doesn't affect the cluster availability. For details, see YDB cluster topology.

  2. In the config.yaml configuration file, change the node host list, replacing the ID of the removed host by the ID of the added host:

    domains_config:
    ...
      state_storage:
      - ring:
          node: [2, 3, 4, 5, 6, 7, 8, 9, 10]
          nto_select: 9
        ssid: 1
    ...
    
  3. Update the config.yaml configuration files for all the cluster nodes, including dynamic nodes.

  4. Use the rolling-restart procedure to restart all the cluster nodes (including dynamic nodes but excluding static nodes on the hosts with node_id:1 and node_id:10). Please note that there must be at least a 15 second delay between host restarts.

  5. Stop static cluster nodes on the hosts with node_id:1 and node_id:10.