Re: Zookeeper client

2010-04-27 Thread Mahadev Konar

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"  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 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" 
>> 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
>> 
>> 



Re: Zookeeper client

2010-04-27 Thread Avinash Lakshman
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 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" 
> 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
>
>


Re: Zookeeper client

2010-04-27 Thread Mahadev Konar
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"  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



Re: Zookeeper Client

2009-08-04 Thread Mahadev Konar
Hi todd,
 yes, zookeeper client is supposed to be thread safe.

Thanks
mahadev


On 8/4/09 1:31 PM, "Todd Greenwood"  wrote:

> Is org.apache.zookeeper.ZooKeeper thread safe?
> 
> I've started walking through the code to check for mutability, and
> although the first level children are protected, I haven't fully walked
> the graph. Perhaps I should ask, is it supposed to be thread safe?
> 
> -Todd