February 2024 Archives

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 Archive

This page is an archive of entries from February 2024 listed from newest to oldest.

November 2023 is the previous archive.

March 2024 is the next archive.

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