[英]Not able to connect to zookeeper from clickhouse
I am using Bitnami Zookeeper AMI for AWS and have configured a 3 node cluster. 我正在使用适用于AWS的Bitnami Zookeeper AMI,并已配置了3节点群集。 I have specified them in my clickhouse configuration file as following.
我已经在我的Clickhouse配置文件中指定了它们,如下所示。
<zookeeper>
<node index="1">
<host>X.X.X.X</host>
<port>2181</port>
</node>
<node index="2">
<host>X.X.X.X</host>
<port>2181</port>
</node>
<node index="3">
<host>X.X.X.X</host>
<port>2181</port>
</node>
</zookeeper>
<macros>
<shard>01</shard>
<replica>ec2-X-X-X-X.compute-1.amazonaws.com</replica>
</macros>
Now when I am trying to create a ReplicatedMergeTree table using the following query on one of my clickhouse node 现在,当我尝试在我的Clickhouse节点之一上使用以下查询创建ReplicatedMergeTree表时
CREATE TABLE ontime_replica (Year UInt16,
Month UInt8,
DayofMonth UInt8,
FlightDate Date
)
ENGINE = ReplicatedMergeTree(
'/clickhouse/tables/{shard}/ontime',
'{replica}',
FlightDate,
(Year, FlightDate),
8192);
I get the following exception 我得到以下异常
Query execution failed
Reason:
SQL Error [999]: ClickHouse exception, code: 999, host: <Clickhouse node IP>, port:
8123; Code: 999, e.displayText() = Coordination::Exception: Not
authenticated, path: /clickhouse, e.what() = Coordination::Exception
In my zookeeper logs I get the following message 在我的动物园管理员日志中,我收到以下消息
2019-01-29 09:44:44,991 [myid:2] - INFO [ProcessThread(sid:2
cport:-1)::PrepRequestProcessor@653] - Got user-level KeeperException when
processing sessionid:0x1000437dc070000 type:create cxid:0x18
zxid:0x700000009 txntype:-1 reqpath:n/a Error Path:null
Error:KeeperErrorCode = NoAuth
Added 添加
skipACL=yes
in my zookeeper config to skip authentication. 在我的zookeeper配置中跳过身份验证。
To connect to zookeeper with login and password you should configure ClickHouse like that: 要使用登录名和密码连接到zookeeper,您应该这样配置ClickHouse:
<yandex>
<zookeeper>
<node index="1">
<host>X.X.X.X</host>
<port>2181</port>
</node>
<node index="2">
<host>Y.Y.Y.Y</host>
<port>2181</port>
</node>
<node index="3">
<host>Z.Z.Z.Z</host>
<port>2181</port>
</node>
<identity>user:password</identity>
</zookeeper>
</yandex>
After changing the configuration you will need to restart ClickHouse server. 更改配置后,您将需要重新启动ClickHouse服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.