-
If I have replicas of a shard (like 3 shards x 2 replicas = 6 nodes) do I need to backup all 6 noodes and when restoring restore even the replicas of the shards? Or is it sufficient to just backup one replica of each shard ( 3 nodes) and then when restored the other replicas will sync with it? |
Beta Was this translation helpful? Give feedback.
Answered by
Slach
Jul 12, 2022
Replies: 1 comment
-
How to make backup / restore sharded clusterBACKUPrun only on the first replica for each shard shard_number=$(clickhouse-client -q "SELECT getMacro('{shard}')")
clickhouse-backup create_remote shard${shard_number}-backup
clickhouse-backup delete local shard${shard_number}-backup RESTORErun on all replicas shard_number=$(clickhouse-client -q "SELECT getMacro('{shard}')")
clickhouse-backup restore_remote --rm --schema shard${shard_number}-backup
clickhouse-backup delete local shard${shard_number}-backup after it, run only on the first replica for each shard shard_number=$(clickhouse-client -q "SELECT getMacro('{shard}')")
clickhouse-backup restore_remote --rm shard${shard_number}-backup
clickhouse-backup delete local shard${shard_number}-backup |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Slach
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to make backup / restore sharded cluster
BACKUP
run only on the first replica for each shard
RESTORE
run on all replicas
after it, run only on the first replica for each shard