com um clique
cluster-operations
// Cluster management: distributed tables, ON CLUSTER DDL, node lifecycle, resharding, load balancing, and Keeper migration.
// Cluster management: distributed tables, ON CLUSTER DDL, node lifecycle, resharding, load balancing, and Keeper migration.
Exact column names for the system tables the agent queries most (processes, query_log, parts, merges, mutations, replicas, replication_queue, disks, settings, zookeeper, users/grants, metrics) plus rules for choosing dedicated tools over raw SQL. Load before hand-writing SQL against system tables.
Schema migrations: ALTER patterns, engine changes, zero-downtime swaps, clickhouse-local offline migrations, and lightweight UPDATE/DELETE strategies.
ReplicatedMergeTree operations, failover procedures, lag diagnosis, quorum writes, and Keeper management.
RBAC configuration, row policies, quotas, network security, audit logging, and access control best practices.
Compression codecs, TTL policies, tiered storage, part management, and disk space optimization.
Production operational practices: insert batching, async writes, query cache, connection pooling, and recommended settings.
| name | cluster-operations |
| description | Cluster management: distributed tables, ON CLUSTER DDL, node lifecycle, resharding, load balancing, and Keeper migration. |
CREATE TABLE dist ENGINE = Distributed(cluster, db, local_table, sharding_key)rand() for even distribution, cityHash64(user_id) for user affinityALTER TABLE t ON CLUSTER '{cluster}' ADD COLUMN col Type — propagate schema to all replicasCREATE TABLE t ON CLUSTER '{cluster}' AS template_db.template_table — clone across shardsdistributed_ddl_output_mode: throw (fail on error), null (ignore), none, activeSELECT * FROM system.distributed_ddl_queueload_balancing: random, in_order, first_or_random, nearest_hostnamemax_replica_delay_for_distributed_queries — skip lagging replicasfallback_to_stale_replicas_for_distributed_queries=1 — use stale when all delayedremote_servers) on all nodesSYSTEM DROP REPLICA for replicated tablesINSERT INTO new_dist SELECT * FROM old_dist or clickhouse-copier for large migrationsSYSTEM RESTART REPLICA ON CLUSTER '{cluster}' — restart replication across all nodesSYSTEM SYNC REPLICA ON CLUSTER '{cluster}' — force sync from ZooKeeperSYSTEM FETCH PARTS ON CLUSTER '{cluster}' — pull missing parts from other replicassystem.clusters — topology; system.distributed_ddl_queue — DDL status; system.replicas — replicationremote() functionclickhouse-keeper-converter or zk-dump.shzookeeper config, restart one node at a time