[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618885#action_12618885
 ] 

Jakob Homan commented on ZOOKEEPER-107:
---------------------------------------

I thought I had along this line was to create an additional constructor that 
takes a URL rather than string for the host.  The constructor could then access 
that URL and get the list of servers from there.  So, assuming the URL pointed 
to an http page, the page returned would just be "hostA:port,hostB:port,etc" 
and the client could proceed with that information.  Or, the URL could point to 
a local file if the server membership wasn't expected to change often.  This 
would eliminate the need for the clients to have any idea ahead of time of 
where to get the hosts.  Particularly if the information were served via http, 
this would move server location to being a DNS/virtualhost problem - the DNS 
for the server-info location could be changed if the server providing the info 
died.  This would go a ways toward adding a restful interface to the 
configuration of the cluster.

So, the client would instantiate with zk  new Zookeeper(new 
URL("http://zkhostinfo:7552";), 1000, this);, receive the list of hosts and work 
from there.  

This would address (though not solve) the issue of adding servers, as new 
servers could be added to the list returned to new clients.

As a corollary, the zk servers could of course serve the list of hosts as an 
optional part of their operation, or this function could be provided by another 
application, directory-style.  This would allow clients to connect to different 
clusters on start-up, if the directory could identify and differentiate clients 
by ip addr or such, and direct them to the appropriate zk group.

If this sounds (reasonable && interesting), I can open a JIRA and work on a 
patch to add the new constructor and client functionality.

> Allow dynamic changes to server cluster membership
> --------------------------------------------------
>
>                 Key: ZOOKEEPER-107
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-107
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: server
>            Reporter: Patrick Hunt
>
> Currently cluster membership is statically defined, adding/removing hosts 
> to/from the server cluster dynamically needs to be supported.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to