Clickhouse Server可以连接到Zookeeper
我正在Azure VM上运行ClickHouse Server,并尝试使用ReplicatedMergetree Engine创建表(遵循本指南: https://medium.com/@merticariug/distributed-clickhouse-configuration-d412c211687c )。 我让Zookeeper在同一子网中的另一个Azure VM上运行。
CREATE TABLE shard.test
(
id Int64,
event_time DateTime
)
Engine=ReplicatedMergeTree('/clickhouse/tables/shard1/test', 'replica_1')
PARTITION BY toYYYYMMDD(event_time)
ORDER BY id;
当我运行上述命令创建一个复制的表时,我会在clickhouse-client上遇到此错误:
Code: 225. DB::Exception: Received from localhost:9000. DB::Exception: Can't create replicated table without ZooKeeper. (NO_ZOOKEEPER)
我没有按下 /eTc /clickhouse-server/config.xml的Zoopkeeper部分,还为Zookeeper添加了一个单独的XML文件。 etc/clickhouse-server/config.d/
这是/etc/clickhouse-server/config.d/zookeeper.xml的内容:
<clickhouse>
<zookeeper>
<node>
<host>public_IP</host>
<port>2181</port>
</node>
</zookeeper>
</clickhouse>
我是否缺少一些配置更改?
I am running Clickhouse server on a Azure VM and trying to create a table using ReplicatedMergeTree engine (following this guide: https://medium.com/@merticariug/distributed-clickhouse-configuration-d412c211687c).
I have zookeeper running on another Azure VM in the same subnet.
CREATE TABLE shard.test
(
id Int64,
event_time DateTime
)
Engine=ReplicatedMergeTree('/clickhouse/tables/shard1/test', 'replica_1')
PARTITION BY toYYYYMMDD(event_time)
ORDER BY id;
When I run the above command to create a replicated table, I get this error on my clickhouse-client:
Code: 225. DB::Exception: Received from localhost:9000. DB::Exception: Can't create replicated table without ZooKeeper. (NO_ZOOKEEPER)
I have uncommented the zoopkeeper portion of /etc/clickhouse-server/config.xml and also added a separate xml file for zookeeper in /etc/clickhouse-server/config.d/
Here is the content of /etc/clickhouse-server/config.d/zookeeper.xml:
<clickhouse>
<zookeeper>
<node>
<host>public_IP</host>
<port>2181</port>
</node>
</zookeeper>
</clickhouse>
Am I missing some config changes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能的问题是网络限制,防火墙...
这应该从CH服务器起作用
probably the problem is network restrictions, firewall, ...
this should work from CH server
在zookeeper.xml中,替换
&lt; clickhouse&gt;
and&lt;/clickhouse&gt;
用&lt; yandex&gt;
and code> and&
&lt;/yandex&gt; yandex&gt; ;
分别。然后使用sudo Service clickhouse-server RESTART
重新启动ClickHouse-Server。In zookeeper.xml, replace
<clickhouse>
and</clickhouse>
with<yandex>
and</yandex>
respectively. Then restart the clickhouse-server usingsudo service clickhouse-server restart
.