一种查找 zookeeper ip 的方法
A way to find the zookeeper ip's
在我们的 (Cloudera CDH) 集群上,我们有 3 个 ZK 节点 运行。
出于打包目的,我正在寻找一种方法来动态获取这些节点的 IP,而不是对它们进行硬编码。
是否缺少任何环境变量或 REST 调用?
我一定是错过了,但是环境变量 ZK_QUORUM 可以解决问题![=11=]
从 cloudera/cm_ext 到 github:
If you add a dependency to ZooKeeper service, then any process in that
service
(e.g. role daemon process, command process, client config deployment
process) will get the ZooKeeper quorum in ZK_QUORUM environment
variable. This can be used in the control script to add configuration
properties for the ZooKeeper quorum.
在我们的 (Cloudera CDH) 集群上,我们有 3 个 ZK 节点 运行。 出于打包目的,我正在寻找一种方法来动态获取这些节点的 IP,而不是对它们进行硬编码。
是否缺少任何环境变量或 REST 调用?
我一定是错过了,但是环境变量 ZK_QUORUM 可以解决问题![=11=]
从 cloudera/cm_ext 到 github:
If you add a dependency to ZooKeeper service, then any process in that service
(e.g. role daemon process, command process, client config deployment process) will get the ZooKeeper quorum in ZK_QUORUM environment variable. This can be used in the control script to add configuration properties for the ZooKeeper quorum.