Managing shards in a ClickHouse cluster
You can group several shards of a ClickHouse cluster in a shard group and save tables in this group.
Listing shard groups in a cluster
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and open the Shard groups tab.
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 get a list of shard groups in a cluster, run the command:
ncp managed-clickhouse shard-groups list \
--cluster-name=<cluster name>
The cluster name can be requested with a list of clusters in the folder.
Viewing detailed information about a shard group
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and open the Shard groups tab.
- Select a shard group to view detailed information.
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 view detailed information about a shard group in a cluster, run the command:
ncp managed-clickhouse shard-groups get \
--cluster-name=<cluster name> \
--name=<shard group name>
The cluster name can be requested with a list of clusters in the folder.
Creating a shard group
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and open the Shard groups tab.
- Click Create shard group.
- Fill in the form fields and click Apply.
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 create a shard group in a cluster, run the command:
ncp managed-clickhouse shard-groups create \
--cluster-name=<cluster name> \
--name=<shard group name> \
--description=<shard group description> \
--shards=<names of shards to include in the group>
The cluster name can be requested with a list of clusters in the folder.
Shard names can be requested with a list of shards in the cluster.
Changing a shard group
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and open the Shard groups tab.
- Click
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 change a shard group in a cluster, run the command:
ncp managed-clickhouse shard-groups update \
--cluster-name=<cluster name> \
--name=<shard group name> \
--description=<new shard group description> \
--shards=<new list of shards to include in the group>
This command replaces the existing list of shards in the group with the new one that was passed to the command in the --shards
parameter. Before running the command, make sure that you added all the appropriate shards in the new list.
The cluster name can be requested with a list of clusters in the folder.
You can request the name of the shard group with a list of shard groups in the cluster.
Shard names can be requested with a list of shards in the cluster.
Deleting a group of shards
Deleting a group of shards doesn't affect the shards in the group: they are kept in the cluster.
Tables created on the deleted group are kept, but they are disabled and attempts to query them result in errors. However, you can delete these tables before or after you delete the shard group.
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and open the Shard groups tab.
- Click
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 delete a shard group in a cluster, run the command:
ncp managed-clickhouse shard-groups delete \
--cluster-name=<cluster name> \
--name=<shard group name>
The cluster name can be requested with a list of clusters in the folder.
You can request the name of the shard group with a list of shard groups in the cluster.