Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

How does the connection string given to CuratorFrameworkFactory#newClient look like? So far I haven't found any information on the web and the JavaDoc doesn't tell me the correct format.

like image 471
Ztyx Avatar asked May 08 '15 23:05

Ztyx


2 Answers

According to this post, it is of the format

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

. For example:

127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183,127.0.0.1:2184
like image 81
Ztyx Avatar answered Oct 11 '22 18:10

Ztyx


Curator is an API client for Apache Zookeeper so the full documented answer to this is available in the 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"

like image 43
Trastle Avatar answered Oct 11 '22 18:10

Trastle