Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Proposal for client-side changes to support dynamic server configuration

Wiki MarkupIn the existing client implementation, a static server list is provided to the ZooKeeper constructor while creating a client object. If the server list contains host names, then the name to IP mapping is performed only once. The server list as well as the resolved IP addresses remains unchanged. With dynamic reconfiguration of ZooKeeper servers \[ 1,2\], ZooKeeper clients need a way to determine the most up-to-date server list.

A. Overview of proposed changes

...

  1. A new optional property “version” will added to the configuration file. The version number indicates the reconfiguration version number and should match the version number returned by ZooKeeper.getConfig() (see 12 for further details). The version number when specified will be used to ensure that the client will be choose the new server list only if the version number of the list is higher than the current version number.
  2. The “server.x=host:serverPort:electionPort” property will be changed to “server.x=host:serverPort:electionPort:clientPort”.

...

The client will refresh from the URL every (n + r) seconds. In addition, the client will trigger a refresh (by waking up the refresh thread) if successive connection attempts to m servers fail. The default value of m will be set to (s/3 + 1), where s is the size of the server list. The value can be set by “zookeeper.refreshAfterNumFailure” system property. If the application wishes to refresh every time the client disconnects from the server then this property can be assigned a value 0.

...

  • Tool to update a password protected HTTP URL.
  • Avoid URL refresh from the same server for each client. This problem is similar to implementing shared sessions.
  • Support for DNS based discovery at the client?
  • For applications that want to use protocols other than file or URL, we could provide a callback mechanism. When the client library needs to retrieve the server list, it will invoke the callback method in the application. It will be responsibility of the application to discover the server list.
  • For applications do not have external web server or file server to record the configuration, we can implement the solution using virtual IPs described in ZOOKEEPER-1031.

E. Related JIRAs

G. References

Wiki Markup
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="97858e6495b2ae3e-8ada3a00-47be49df-b796adce-2c9c77948895b49c3ce2fddd"><ac:parameter ac:name="">107</ac:parameter></ac:structured-macro> \[1\]  JIRA for dynamic cluster membership. [https://issues.apache.org/jira/browse/ZOOKEEPER-107
]

Wiki Markup
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="d09175eb15cd4db4-606aa605-477b43cc-afb49149-206130fea5cd648aa53f5b9f"><ac:parameter ac:name="">107wiki</ac:parameter></ac:structured-macro> \[2\] Cluster membershipMembership design. [https://cwiki.apache.org/confluence/display/ZOOKEEPER/ClusterMembership]