Updating ClickHouse cluster settings
If you have a ClickHouse® cluster in your project, you can update its settings.
-
Open the
ClickhouseClusterresource, e.g., using theopen ch-cluster.yamlcommand. -
Open the resource file and edit the following properties:
spec.clickhouse.stop: Stopping a cluster.trueto stop,falseto run a cluster.spec.clickhouse.service: Service type for the entire cluster. Available values:None,ClusterIP(default), orLoadBalancer.spec.clickhouse.enableSuperuserAccess: Enabling superuser access.spec.clickhouse.superuserSecretRef.name: Name of the secret with superuser credentials.spec.clickhouse.resources.requests.cpu: Number of CPUs requested for the ClickHouse® pod.spec.clickhouse.resources.requests.memory: RAM requested for the ClickHouse® pod.spec.clickhouse.resources.limits.cpu: Maximum number of CPUs for the ClickHouse® pod.spec.clickhouse.resources.limits.memory: Maximum RAM for the ClickHouse® pod.spec.clickhouse.storage.size: Storage size for ClickHouse®. You can only increase it.spec.clickhouse.storage.storageClass: Storage class for ClickHouse®.spec.clickhouse.shards[].id: Shard ID. Updating this parameter will delete the shard together with its data and create a new one with a new name.spec.clickhouse.shards[].instances: Number of instances per shard.spec.clickhouse.shards[].weight: Shard weight for data distribution.spec.clickhouse.shards[].service: Service type for the shard, Available values:None(default, no endpoint created),ClusterIPorLoadBalancer.spec.keeper.instances: Number of ClickHouse® Keeper instances.spec.keeper.resources.requests.cpu: Number of CPUs requested for the Keeper pod.spec.keeper.resources.requests.memory: RAM requested for the Keeper pod.spec.keeper.resources.limits.cpu: Maximum number of CPUs for the Keeper pod.spec.keeper.resources.limits.memory: Maximum RAM for the Keeper pod.spec.keeper.storage.size: Storage size for Keeper. You can only increase it.spec.keeper.storage.storageClass: Storage class for Keeper.spec.backup.schedule: Backup schedule in cron format.spec.backup.storage.type: Storage type for backups, e.g.,stackland-storage.spec.backup.storage.stacklandStorage: Stackland Storage settings for backups.
-
Apply the manifest:
kubectl apply -f ch-cluster.yaml -n <project name>. Optionally, you can specify the project name in themetadata.namespaceresource property and skip it in the command.
-
If you have not opened a project yet, select one.
-
In the left-hand menu, select ClickHouse® Clusters.
-
Select a cluster.
-
Click Edit.
-
Edit the following fields:
Basic parameters
- Cluster name: Only lowercase letters, numbers, and hyphens.
- Version: ClickHouse® DBMS version.
- Cluster service type: Service type for accessing the entire cluster. Available values:
ClusterIP(access only within the cluster) orLoadBalancer(access from outside).
Storage
- Storage class: Storage class for ClickHouse® data.
- Storage size: Data storage size. You can only increase it.
Settings
- Expanding section for addition of custom ClickHouse® settings. Click + Add setting to add a name-value pair.
Resources
- Requested CPUs: Number of CPUs requested for the ClickHouse® pod.
- Requested RAM: RAM requested for the ClickHouse® pod.
- CPU limit: Maximum number of CPUs for the ClickHouse® pod.
- RAM limit: Maximum RAM for the ClickHouse® pod.
Shards
For each shard, e.g.,
shard-1orshard-2, you can configure:- Shard ID: Shard ID.
- Shard weight: Shard weight for data distribution (from 0 to 100).
- Number of replicas: Number of replicas per shard (from 0 to 10).
- Shard service type: Service type for access to the shard. Available values:
Disabled(no endpoint is created),ClusterIP(access only within the cluster), orLoadBalancer(access from outside). - Override: Expanding section for overriding the settings of a particular shard:
- Storage: Overriding the shard's storage class and size.
- Resources: Overriding the shard’s computing resources (CPUs and RAM).
- Settings: Overriding the shard’s custom settings.
- Delete shard: Shard deletion button.
Click + Add shard to add a new shard to the cluster.
Superuser
- Allow access: Switch to allow superuser access to the cluster.
ClickHouse® Keeper
- Number of instances: Number of ClickHouse® Keeper instances for cluster coordination (1, 3, 5, or 7).
- Keeper host class: Computing resources and storage for Keeper. Displays information about storage, CPUs and RAM.
Backup configuration
- Enable automatic backups: Switch to enable automatic backups.
- Backup schedule: Backup schedule in cron format, e.g.,
0 0 * * * *. - Delta backups between complete ones: Number of incremental backups between complete ones (from 3 to 10).
-
Click Save.
This is it, your cluster settings have been updated.