clickhouse 数据损坏的跳过方法

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

Monthly Archives

Pages

Powered by Movable Type 8.0.2

About this Entry

This page contains a single entry by Cnangel published on February 27, 2024 10:31 PM.

针对docker容器无法使用gpu的问题 was the previous entry in this blog.

解决https页面请求http出现block:mixed-content is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.