ClickHouse Keeper 集群中的元数据丢失或损坏
Exception: No metadata in ZooKeeper for /clickhouse/tables/01/table_name/replicas/02: table will be in readonly mode
可参考官网 在数据完全丢失后的恢复 或删除分布式表 /var/lib/clickhouse/metadata/db_name/table_name.sql 文件后然后再按照«创建可复制表»中的描述重新创建副本。
./clickhouse-client --multiline -h 127.0.0.1 --port 9000 -u default --password --query "SELECT replica\_path || '/queue/' || node\_name FROM system.replication\_queue JOIN system.replicas USING (database, table) WHERE create\_time < now() AND last\_exception LIKE '%No active replica has part%'" | while read i; do echo "zkCli.sh -server 127.0.0.1:2181 delete \$i" ; done
SYSTEM RESTART REPLICAS