Managing ZooKeeper hosts
Single-host shards are not fault-tolerant and do not offer data replication. To make such shards fault-tolerant, increase the number of hosts in them by one or more. If a cluster already contains a multi-host shard, you can immediately add ClickHouse hosts to the desired shard. Otherwise, you must first enable fault tolerance and only then will you be able to add ClickHouse hosts.
For more information, see Sharding.
You can add and delete ZooKeeper hosts in fault-tolerant clusters. A fault-tolerant cluster can contain a total of three to five ZooKeeper hosts.
Warning
If fault tolerance is already enabled for the cluster and ZooKeeper hosts are created, you can't delete all these hosts because there are always at least 3 ZooKeeper hosts in the cluster.
To learn more, see Replication.
Enabling fault tolerance for the cluster
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and open the Hosts tab.
- Click Set up ZooKeeper hosts at the top right.
- Specify the host class.
- Set up the storage settings.
- Change the ZooKeeper host settings, if required. To do this, hover over the required host row and click
. - Click Save changes.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To enable fault tolerance for a cluster:
-
View a description of the CLI command for adding ZooKeeper hosts:
ncp managed-clickhouse cluster add-zookeeper --help
-
Run the operation with the default host characteristics:
ncp managed-clickhouse cluster add-zookeeper <cluster name> \ --host zone-id=eu-north1-c,subnet-name=default-eu-north1-c \ --host zone-id=eu-north1-c,subnet-name=default-eu-north1-c \ --host zone-id=eu-north1-c,subnet-name=default-eu-north1-c
The cluster name can be requested with a list of clusters in the folder.
Note
ZooKeeper hosts get the following specs by default:
c3-c2-m4
host class.- 10 GB of network SSD storage (
network-ssd
).
Adding a ZooKeeper host
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and select the Hosts tab.
- Click Add ZooKeeper hosts.
- If required, change the host settings.
- Click Save.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To add a host to a cluster:
-
Collect the necessary information:
-
Request the subnet ID by running the command:
ncp vpc subnet list
-
You can get the cluster name with a list of clusters in the folder.
-
-
View a description of the CLI command for adding a host:
ncp managed-clickhouse host add --help
-
Run the add ZooKeeper host command:
ncp managed-clickhouse hosts add \ --cluster-name <cluster name \ --host zone-id=<availability zone>,subnet-id=<subnet ID>,type=zookeeper
Deleting a ZooKeeper host
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and select the Hosts tab.
- Hover over the required host row and click
. - In the window that opens, click Delete.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To remove a host from the cluster, run:
ncp managed-clickhouse hosts delete <host name> \
--cluster-name=<cluster name>
The host name can be requested with a list of cluster hosts, and the cluster name can be requested with a list of clusters in the folder.