当Clickhouse服务器强制关闭、异常断电、以及数据拷贝时等,导致Clickhouse数据损坏,服务无法启动,提示:
<Error> Application: DB::Exception: Suspiciously big size (4 parts, 1.05 GiB in total) of all broken parts to remove while maximum allowed broken parts size is 1.00 GiB. You can change the maximum value with merge tree setting 'max_suspicious_broken_parts_bytes' in <merge_tree> configuration section or in table settings in .sql file (don't forget to return setting back to default value): Cannot attach table `ads`.`xxx_tbl` from metadata file /var/lib/clickhouse/store/
需要在/etc/clickhouse-server/config.d配置中增加max_suspicious_broken_parts.xml文件,内容如下:
<?xml version="1.0"?>
<yandex>
<merge_tree>
<max_suspicious_broken_parts>1000</max_suspicious_broken_parts>
<max_suspicious_broken_parts_bytes>2147483648</max_suspicious_broken_parts_bytes>
</merge_tree>
</yandex>
然后启动Clickhouse即可:
systemctl start clickhouse-server.service