apache zookeeper - How to get znode ip -


i have many services connected zookeeper, , want service can service b's ip, when service b connected zookeeper, there api can that? or have use other config file write down services's ip?

take if solves problem: http://curator.apache.org/curator-x-discovery/

zookeeper doesn't provide service discovery out of box, easy implement yourself.

you won't able ip addresses of other connected clients (services, in case) straight zookeeper api. in order other services connected cluster, each service has individually create ephemeral znode under specific path, e.g. /services, , set necessary addressing , naming info znode's data (ip, port, etc). way, can list path , discover active services, or watch /services path changes in service configuration.

since services creating ephemeral nodes, automatically removed once disconnected , session expires. of course, once start doing this, see there many small details , design decisions have make, ergo mentioned curator recipe.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -