You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Jun Rao <ju...@almaden.ibm.com> on 2009/04/13 22:30:02 UTC

starting replicated ZK server


>From the ZK web site, it's not clear how to set up a multi-node ZK service.
It seems that one has to add the server entries in the conf file and create
myid files on each node. Then, how should I start the ZK nodes? I tried
issuing "zkServer start" from each node and that didn't seem to work. Is
that the right way to start the service? Also, once the service is up, is
there a way to check the list of nodes used by ZK and which node is the
leader? Thanks,

Jun
IBM Almaden Research Center
K55/B1, 650 Harry Road, San Jose, CA  95120-6099

junrao@almaden.ibm.com

RE: starting replicated ZK server

Posted by Benjamin Reed <br...@yahoo-inc.com>.
hi jun!

you are doing everything correctly. did you read the "Getting Started Guide"?

you can telnet to the client port and issue four letter commands (see the "Administrator's Guilde" to see what is going on. in particular "stat" will give you the information you want.

ben
________________________________________
From: Jun Rao [junrao@almaden.ibm.com]
Sent: Monday, April 13, 2009 1:30 PM
To: zookeeper-user@hadoop.apache.org
Subject: starting replicated ZK server

>From the ZK web site, it's not clear how to set up a multi-node ZK service.
It seems that one has to add the server entries in the conf file and create
myid files on each node. Then, how should I start the ZK nodes? I tried
issuing "zkServer start" from each node and that didn't seem to work. Is
that the right way to start the service? Also, once the service is up, is
there a way to check the list of nodes used by ZK and which node is the
leader? Thanks,

Jun
IBM Almaden Research Center
K55/B1, 650 Harry Road, San Jose, CA  95120-6099

junrao@almaden.ibm.com

Re: starting replicated ZK server

Posted by Jun Rao <ju...@almaden.ibm.com>.
It works now, thanks. My configuration had a conflict between clientPort
and one of the server ports.

Jun
IBM Almaden Research Center
K55/B1, 650 Harry Road, San Jose, CA  95120-6099

junrao@almaden.ibm.com


Patrick Hunt <ph...@apache.org> wrote on 04/13/2009 01:45:08 PM:

>
> Jun Rao wrote:
> >
> > From the ZK web site, it's not clear how to set up a multi-node ZK
service.
> > It seems that one has to add the server entries in the conf file and
create
> > myid files on each node. Then, how should I start the ZK nodes? I tried
> > issuing "zkServer start" from each node and that didn't seem to work.
Is
> > that the right way to start the service? Also, once the service is up,
is
> > there a way to check the list of nodes used by ZK and which node is the
> > leader? Thanks,
> >
>
> See this for a step-by-step guide:
> http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.
> html#sc_zkMulitServerSetup
> In particular steps 4 & 5.
>
> your config should look something like (for 3 server ensemble):
> tickTime=2000
> dataDir=/path/to/data/dir
> clientPort=2181
> initLimit=5
> syncLimit=2
> server.1=host1.foo.com:2888:2889
> server.2=host2.foo.com:2888:2889
> server.3=host3.foo.com:2888:2889
>
> this file needs to exist (available to) each of the servers in the
> ensemble. Try the command line listed in step 5 to start the server
> (conf in the classpath is there to pickup the log4j configuration, you
> could use that to debug). The myid file needs to exist in each server's
> dataDir (not shared of course).
>
> Either JMX, the logs, or the stat command documented here:
> http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.
> html#sc_zkCommands
> will give insight on things like which server is the leader. The stat
> command is the simplest (nc to the clientPort of the server and issue
> the stat command).
>
> Patrick
>

Re: starting replicated ZK server

Posted by Patrick Hunt <ph...@apache.org>.
Jun Rao wrote:
> 
> From the ZK web site, it's not clear how to set up a multi-node ZK service.
> It seems that one has to add the server entries in the conf file and create
> myid files on each node. Then, how should I start the ZK nodes? I tried
> issuing "zkServer start" from each node and that didn't seem to work. Is
> that the right way to start the service? Also, once the service is up, is
> there a way to check the list of nodes used by ZK and which node is the
> leader? Thanks,
> 

See this for a step-by-step guide:
http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html#sc_zkMulitServerSetup
In particular steps 4 & 5.

your config should look something like (for 3 server ensemble):
tickTime=2000
dataDir=/path/to/data/dir
clientPort=2181
initLimit=5
syncLimit=2
server.1=host1.foo.com:2888:2889
server.2=host2.foo.com:2888:2889
server.3=host3.foo.com:2888:2889

this file needs to exist (available to) each of the servers in the 
ensemble. Try the command line listed in step 5 to start the server 
(conf in the classpath is there to pickup the log4j configuration, you 
could use that to debug). The myid file needs to exist in each server's 
dataDir (not shared of course).

Either JMX, the logs, or the stat command documented here:
http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html#sc_zkCommands
will give insight on things like which server is the leader. The stat 
command is the simplest (nc to the clientPort of the server and issue 
the stat command).

Patrick