项目场景:在clickhouse中创建副本表


问题描述:

创建副本表之后,插入数据,在副本服务器上查不到数据

CREATE TABLE default.test_distribute ON CLUSTER clickhouse_remote_servers(`EventDate` DateTime,`id` UInt64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/default/test_distribute', '{replica}') PARTITION BY toYYYYMM(EventDate) ORDER BY id;

CREATE TABLE default.test_distribute_all ON CLUSTER clickhouse_remote_servers(`EventDate` DateTime,`id` UInt64) ENGINE = Distributed(clickhouse_remote_servers, default, test_distribute, rand());

insert into test_distribute  values('2021-10-11 12:28:30',22,2);


原因分析:

经过检查配置文件,并没有发现问题,通过查看clickhouse的错误日志,发现了问题
	cat /var/log/clickhouse-server/clickhouse-server.err.log
	2021.10.11 15:45:57.518772 [ 8756 ] {} <Error> default.test_log (3f78b238-92aa-4cf8-bf78-b23892aadcf8): auto DB::StorageReplicatedMergeTree::processQueueEntry(Replica::SelectedEntryPtr)::(anonymous class)::operator()(DB::StorageReplicatedMergeTree::LogEntryPtr &) const: Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = 
	timed out: 10.131.52.38:9009
	, Stack trace (when copying this message, always include the lines below):

解决方案:

关闭副本所在主机的防火墙即可。

部署参考:
[1]: http://fuxkdb.com/2020/05/02/2020-05-02-ClickHouse%E5%A4%9A%E5%AE%9E%E4%BE%8B%E9%83%A8%E7%BD%B2/

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐