[
https://issues.apache.org/jira/browse/ZOOKEEPER-2225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14608475#comment-14608475
]
Raul Gutierrez Segales commented on ZOOKEEPER-2225:
---------------------------------------------------
I agree that having that endpoint would be good, but note that there are many
other cheap ways of doing this in 3.5. If you are using local sessions (which
you should!), sessions are cheap so you can have your clients grab a copy of
the config (and easily parse the servers) by doing something like this from
cron or similar:
{code}
$ zk-shell --run-once "get /zookeeper/config" server1:server2:server3
{code}
(See more about zk-shell, a zkCli clone, here:
https://github.com/rgs1/zk_shell).
Also, under the hood zk-shell uses Kazoo to do reconfig operations:
https://github.com/python-zk/kazoo/commit/8d2db77794d59ce6d9ebab19cf281b8d24093810.
If you really wanted an HTTP interface it would be trivial to do a Python
wrapper around Kazoo that exposes this (something like:
https://github.com/phunt/zookeeper_dashboard) since you only want to read
/zookeeper/config.
> modify existing 'configuration' command or add new one to return list of
> ZooKeeper's ensemble members
> -----------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-2225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2225
> Project: ZooKeeper
> Issue Type: Improvement
> Components: server
> Environment: Linux, AWS cloud
> Reporter: Grigoriy Starchenko
>
> Hi, All
> We are building high-availability ZooKeeper cluster at AWS and using version
> 3.5.0 because it support dynamic re-configuration. Everything works but one
> problem: it is difficult for ZooKeeper clients to discover current ensemble
> list. Obvious solution is to put ZooKeeper behind AWS load balancer. Client
> during initialization will call ZooKeeper via load balancer to read
> /zookeeper/config and will be able to build connection string. We quickly
> discovered ZooKeeper API not working trough AWS load-balancer.
> ZooKeeper, starting from 3.5.0, support AdminServer option which working
> just fine behind any type of load balancers. The catch is: no command avail
> to date to get list of hosts representing ensemble.
> http://localhost:8080/commands/...
> provide a lot of info but none of them returns
> {code}
> server.4108=10.50.4.108:2888:3888:participant;0.0.0.0:2181
> server.316=10.50.3.16:2888:3888:participant;0.0.0.0:2181
> server.1215=10.50.1.215:2888:3888:participant;0.0.0.0:2181
> version=100000000
> {code}
> I think it would be very useful add new command:
> http://localhost:8080/commands/dconfig
> which will return current ZooKeeper dynamic comfiguration:
> {code}
> {
> "server.4108" : "10.50.4.108:2888:3888:participant;0.0.0.0:2181",
> "server.316" : "10.50.3.16:2888:3888:participant;0.0.0.0:2181",
> "server.1215" : "10.50.1.215:2888:3888:participant;0.0.0.0:2181"
> "version" : "100000000"
> }
> {code}
> Thank you,
> Grisha
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)