org.apache.zookeeper.server.quorum
Class QuorumPeerMain

java.lang.Object
  extended by org.apache.zookeeper.server.quorum.QuorumPeerMain

public class QuorumPeerMain
extends Object

Configuration file

When the main() method of this class is used to start the program, the file "zoo.cfg" in the current directory will be used to obtain configuration information. zoo.cfg is a Properties file, so keys and values are separated by equals (=) and the key/value pairs are separated by new lines. The following keys are used in the configuration file:
  1. dataDir - The directory where the zookeeper data is stored.
  2. clientPort - The port used to communicate with clients.
  3. tickTime - The duration of a tick in milliseconds. This is the basic unit of time in zookeeper.
  4. initLimit - The maximum number of ticks that a follower will wait to initially synchronize with a leader.
  5. syncLimit - The maximum number of ticks that a follower will wait for a message (including heartbeats) from the leader.
  6. server.id - This is the host:port that the server with the given id will use for the quorum protocol.
In addition to the zoo.cfg file. There is a file in the data directory called "myid" that contains the server id as an ASCII decimal value.


Constructor Summary
QuorumPeerMain()
           
 
Method Summary
static void main(String[] args)
          To start the replicated server specify the configuration file name on the command line.
static void runPeer(QuorumPeer.Factory qpFactory)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuorumPeerMain

public QuorumPeerMain()
Method Detail

main

public static void main(String[] args)
To start the replicated server specify the configuration file name on the command line.

Parameters:
args - command line

runPeer

public static void runPeer(QuorumPeer.Factory qpFactory)


Copyright © 2009 The Apache Software Foundation