Replacing a host that uses KUMA storage

May 15, 2024

ID 272402

To replace a host that uses KUMA storage with another one:

  1. Fill in the expand.inventory.yml file, specifying the parameters of the host you want to replace.
  2. Run the following command, specifying the expand.inventory.yml file to remove the host:

    ./kdt invoke kuma --action removeHosts --param hostInventory=<path_to_inventory_file>

  3. Fill in the expand.inventory.yml file, specifying the parameters of the new host that you want to replace the previous host, and then run the following command:

    ./kdt invoke kuma --action addHosts --param hostInventory=<path_to_inventory_file>

  4. Follow steps 2-6 of the instruction for adding new hosts for KUMA services to add a new host with the KUMA storage.

The host with the KUMA storage is replaced with another one.

If your storage configuration includes a shard containing two replicas, and you replaced the second replica host with a new one by using the steps described above, then you may receive an error when installing a new replica. In this case, the new replica will not work.

To fix an error when adding a new replica of a shard:

  1. On another host with a replica of the same shard that owns the incorrectly added replica, launch the ClickHouse client by using the command:

    /opt/kaspersky/kuma/clickhouse/bin/client.sh

    If this host is unavailable, run the client on any other host with a replica included in the same storage cluster.

  2. Run the command to remove the data about the host you wanted to replace.
    • If the host with a replica of the same shard that owns the incorrectly added replica is available, run the following command:

      SYSTEM DROP REPLICA '<replica number of read-only node>' FROM TABLE kuma.events_local_v2

    • If you are using another storage cluster host with a replica, run the following command:

      SYSTEM DROP REPLICA '<replica number of read-only node>' FROM ZKPATH '/clickhouse/tables/kuma/<shard number of read-only node>/kuma/events_local_v2

  3. Run the following command to restore the operation of the added host with a replica:

    SYSTEM RESTORE REPLICA kuma.events_local_v2

Operability of the added host with a replica is restored.

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.