hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Posse <ruipo...@gmail.com>
Subject Re: ZooKeeper Leader Election
Date Fri, 08 Oct 2010 14:37:02 GMT
Problem solved and it was an issue in my code.

Sorry about this. Only when i wrote the issue i was able to understand the


On Fri, Oct 8, 2010 at 3:30 PM, Posse <ruiposse@gmail.com> wrote:

> Hi all,
> I'm new to ZooKeeper and i have to implement Leader Election using it.
> I've read lots of information about, and i'm following the pseudo-code
> available at
> http://hadoop.apache.org/zookeeper/docs/r3.0.0/recipes.html#sc_leaderElection
> I'll describe my problem:
> When i create a znode in client one using the following code, everything
> works fine and a "/election/n_0000000000" znode is created. I can tell that,
> because of the output of "path".
>         String path = "/election/n_";
>>         path = zk.create(path, new byte[0], Ids.OPEN_ACL_UNSAFE,
>>                 CreateMode.EPHEMERAL_SEQUENTIAL);
>>         System.out.println(path);
> But, when i use the same code in client two, the output is simply
> "/election/n_".
> I think it should be something like "/election/n_0000000001", so then i can
> compare znodes to tell who's the leader.
> Is there something wrong about what i'm doing?
> Thank you.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message