无法从 clickhouse 连接到 zookeeper
Not able to connect to zookeeper from clickhouse
我正在使用 Bitnami Zookeeper AMI for AWS 并配置了一个 3 节点集群。我在我的 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>
现在,当我尝试在我的一个 clickhouse 节点上使用以下查询创建一个 ReplicatedMergeTree table
CREATE TABLE ontime_replica (Year UInt16,
Month UInt8,
DayofMonth UInt8,
FlightDate Date
)
ENGINE = ReplicatedMergeTree(
'/clickhouse/tables/{shard}/ontime',
'{replica}',
FlightDate,
(Year, FlightDate),
8192);
我得到以下异常
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
在我的动物园管理员日志中,我收到以下消息
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
已添加
skipACL=yes
在我的 zookeeper 配置中跳过身份验证。
要使用登录名和密码连接到 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>
更改配置后,您需要重新启动 ClickHouse 服务器。
我正在使用 Bitnami Zookeeper AMI for AWS 并配置了一个 3 节点集群。我在我的 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>
现在,当我尝试在我的一个 clickhouse 节点上使用以下查询创建一个 ReplicatedMergeTree table
CREATE TABLE ontime_replica (Year UInt16,
Month UInt8,
DayofMonth UInt8,
FlightDate Date
)
ENGINE = ReplicatedMergeTree(
'/clickhouse/tables/{shard}/ontime',
'{replica}',
FlightDate,
(Year, FlightDate),
8192);
我得到以下异常
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
在我的动物园管理员日志中,我收到以下消息
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
已添加
skipACL=yes
在我的 zookeeper 配置中跳过身份验证。
要使用登录名和密码连接到 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>
更改配置后,您需要重新启动 ClickHouse 服务器。