This guide assumes that the If you have configured a different data path, replace all instances of
<path> parameter in your config.xml file is set to:/var/lib/clickhouse in the below commands with the actual value of your <path> setting.1
Copy access configuration from the healthy replica
Copy the contents of the
access folder which contains local users from the healthy replica:2
Back up the metadata folder from the healthy replica
- Navigate to the ClickHouse data directory:
- Create a backup of the metadata folder (including symbolic links): The metadata directory contains DDLs for databases and tables.
The database directory has symlinks to
/var/lib/clickhouse/store/..which contains all the table DDLs.
This command ensures that both the metadata files, and the symlink architecture are preserved in the backup.
3
Restore the metadata on the faulty replica
- Copy the generated
backup.tarfile to the faulty replica. - Extract it to the ClickHouse data directory:
4
Create the force restore flag
To trigger automatic data synchronization from other replicas, create the following flag:
5
Restart the faulty replica
- Restart the ClickHouse server on the faulty node.
- Check the server logs, you should observe parts being downloaded from the healthy replicas: