Skip to content

Backup of replicas of a shard #469

Closed Answered by Slach
samene asked this question in Q&A
Discussion options

You must be logged in to vote

How to make backup / restore sharded cluster

BACKUP

run 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

RESTORE

run 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
…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Slach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants