有没有更好的方法连接到Zookeeper?

时间:2015-04-12 12:35:49

标签: java apache-zookeeper

根据APIDOC: https://zookeeper.apache.org/doc/r3.2.2/api/org/apache/zookeeper/ZooKeeper.html

public org.apache.zookeeper.ZooKeeper.ZooKeeper(
  String connectString,
  int sessionTimeout,
  Watcher watcher) throws IOException

上面的函数接受连接字符串,它只是主机:端口的CSV,对我来说,看起来像某个代码/ constants / xml / config-service所需的硬编码。但是,随着拥有Zookeeper的主机可以继续更改此字符串可能会在任何时间点变得陈旧,而System-Admin与Developer通信进行升级可能会导致延迟。

我们还有其他更好/动态的方式来连接到zookeeper吗?

看下面但是所有人都在做主持人:端口。

  1. connecting to zookeeper in different server
  2. configure Druid to connect to Zookeeper on port 5181

0 个答案:

没有答案
相关问题