Apache Curator "connection string" 是什么样子的?

What does an Apache Curator "connection string" look like?

提供给 CuratorFrameworkFactory#newClient 的连接字符串是什么样子的?到目前为止,我还没有在网上找到任何信息,JavaDoc 也没有告诉我正确的格式。

根据this post,格式为

IP1:PORT1,IP2:PORT2,...,IPn:PORTn

。例如:

127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183,127.0.0.1:2184

Curator 是 Apache Zookeeper 的 API 客户端,因此 Zookeeper Javadocs 中提供了对此的完整记录答案: Zookeeper Javadocs

connectString - comma separated host:port pairs, each corresponding to a zk server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" If the optional chroot suffix is used the example would look like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a" where the client would be rooted at "/app/a" and all paths would be relative to this root - ie getting/setting/etc... "/foo/bar"