配置 Druid 以连接到端口 5181 上的 Zookeeper

configure Druid to connect to Zookeeper on port 5181

我正在 运行 构建一个 MapR 集群,想用 Druid 做一些时间序列分析。 MapR 为 Zookeeper 使用非标准端口(端口 5181 而不是常规端口 2181)。

当我启动 Druid 协调器服务时,它尝试连接到传统的 Zookeeper 端口但失败了:

2015-03-03T17:46:49,614 INFO [main-SendThread(localhost:2181)] org.apache.zookeeper.ClientCnxn - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181.
2015-03-03T17:46:49,617 WARN [main-SendThread(localhost:2181)] org.apache.zookeeper.ClientCnxn - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused

Druid documentation表明可以通过config/_common/common.runtime.properties中的druid.zk.service.host属性设置Zookeeper主机。它没有指定 属性 来编辑 Zookeeper 端口。

Druid 的 Zookeeper 端口是否可配置?或者如果将 Druid 与 MapR 一起使用,是否需要 运行 额外的 Zookeeper 服务?

解决方案是将端口添加到 config/_common/common.runtime.properties 中的主机名:

 druid.zk.service.host=zkNode1:5181,zkNode2:5181,zkNode3:5181

它是可配置的,你可以有类似

druid.zk.service.host=localhost:8080