异常描述
重启clickhouse后,发现服务一直不可用,日志报错:
<Error> Application: Caught exception while loading metadata: Code: 231. DB::Exception: Suspiciously big size (2 parts, 10.25 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 `db`.`tabele` from metadata file /data1/clickhouse/store/c46/c460fc04-b810-4e3e-92a6-8234a00b6b1e/table.sql from query ATTACH TABLE db.table UUID 'e4601526-e850-454f-b081-d7b4e337a826'
原因解析
查找要原因是因为在重启clickhouse这段时间内,副本表写入了大量数据,造成该节点跟副本数据块差距过大无法正常恢复。
可以调整
max_suspicious_broken_parts_bytes
跟
max_suspicious_broken_parts
的参数来解决
参数官网地址:https://clickhouse.com/docs/en/operations/settings/merge-tree-settings/#max_suspicious_broken_parts_bytes
解决方法
在clickhouse的config.xml里添加下面内容
<merge_tree>
<max_suspicious_broken_parts>1000</max_suspicious_broken_parts>
<max_suspicious_broken_parts_bytes>107374182400</max_suspicious_broken_parts_bytes>
</merge_tree>
重启Clickhouse 问题解决
systemctl restart clickhouse-server.service
版权声明:本文为weixin_42270217原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。