Re: How to expire a session

2009-09-25 Thread Benjamin Reed
so you have two problems going on. both have the same root: zookeeper_init returns before a connection and session is established with zookeeper, so you will not be able to fill in myid until a connection is made. you can do something with a mutex in the watcher to wait for a connection, or you

Re: The idea behind 'myid'

2009-09-25 Thread Eric Bowman
Benjamin Reed wrote: > you and ted are correct. the id gives zookeeper a stable identifier to > use even if the ip address changes. if the ip address doesn't change, > we could use that, but we didn't want to make that a built in > assumption. if you really do have a rock solid ip address, you coul

How to expire a session

2009-09-25 Thread Leonard Cuff
In the FAQ, there is a question 4. Is there an easy way to expire a session for testing? And the last part of the answer reads: In the case of testing we want to cause a problem, so to explicitly expire a session an application connects to ZooKeeper, saves the session id and

Re: The idea behind 'myid'

2009-09-25 Thread Benjamin Reed
you and ted are correct. the id gives zookeeper a stable identifier to use even if the ip address changes. if the ip address doesn't change, we could use that, but we didn't want to make that a built in assumption. if you really do have a rock solid ip address, you could make a wrapper startup

Re: The idea behind 'myid'

2009-09-25 Thread Eric Bowman
Another way of doing it, though, would be to tell each instance which IP to use at startup. That way the config can be identical for all users, and there can be whatever logic is required to figure out the right IP address, in the place where logic executing anyhow. I do agree that maintaining th

Re: The idea behind 'myid'

2009-09-25 Thread Ted Dunning
A server doesn't have a unique IP address. Each interface can have 1 or more IP addresses and there can be many interfaces. Furthermore, an IP address can move from one machine to another. 2009/9/25 Ørjan Horpestad > Hi Ben > > Well, im just wondering why the server's own unique IP-address isn

Re: The idea behind 'myid'

2009-09-25 Thread Ørjan Horpestad
Hi Ben Well, im just wondering why the server's own unique IP-address isn't good enough as a valid identifyer; it strikes me to be a bit exhausting to manually set the id for each server in the cluster. Or maybe there is some details im not getting here :-) Regards, Orjan On Fri, Sep 25, 2009 a

Re: The idea behind 'myid'

2009-09-25 Thread Benjamin Reed
can you clarify what you are asking for? are you just looking for motivation? or are you trying to find out how to use it? the myid file just has the unique identifier (number) of the server in the cluster. that number is matched against the id in the configuration file. there isn't much to sa

The idea behind 'myid'

2009-09-25 Thread Ørjan Horpestad
Hi! Can someone pin-point me to a site (or please explain ) where I can read about the use of the myid-file for configuring the id of the ZooKeeper servers? I'm sure there is a good reason for using this approach, but it is the first time I have come over this type of non-automatic way for administ