我正在使用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表时
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
答案 0 :(得分:1)
已添加
skipACL=yes
在我的zookeeper配置中跳过身份验证。
答案 1 :(得分:1)
要使用登录名和密码连接到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服务器。