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:
In particular steps 4 & 5.

your config should look something like (for 3 server ensemble):

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:
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).


Reply via email to