Hi Avinash, No, the randomization only happens on the list of servers that are passed to the client. If you just pass A to the client, the client will only be able to connect to A and will not know about the other servers.
Does that help? Thanks mahadev On 4/27/10 11:40 AM, "Avinash Lakshman" <avinash.laksh...@gmail.com> wrote: > Thanks Mahadev. Does this happen irrespective of what I provide in the > connect string? Let's say I have servers A, B, C, D and E in the ZK cluster. > But all my clients instantiate ZooKeeper instances by providing information > only about A. Does the randomization occur even in this case? > > Thanks > Avinash > > On Tue, Apr 27, 2010 at 11:00 AM, Mahadev Konar <maha...@yahoo-inc.com>wrote: > >> HI Avinash, >> The zk client does itself maintain liveness information and also >> randomizes the list of servers to balance the number of clients connected >> to >> a single ZooKeeper server. >> >> Hope that helps. >> >> Thanks >> mahadev >> >> >> On 4/27/10 10:56 AM, "Avinash Lakshman" <avinash.laksh...@gmail.com> >> wrote: >> >>> Let's assume I have 100 clients connecting to a cluster of 5 Zookeeper >>> servers over time. On the client side I instantiate a ZooKeeper instance >> and >>> use it whenever I need to read/write into ZK. Now I know I can pass in a >>> connect string with the list of all servers that make up the ZK cluster. >>> Does the ZK client automatically maintain liveness information and load >>> balance my connections across the machines? How can I do this >> effectively? I >>> basically want to spread the connections from the 100 clients to the 5 ZK >>> instances effectively. >>> >>> Thanks >>> Avinash >> >>