org.apache.zookeeper.server.quorum
Class QuorumPeerMain
java.lang.Object
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:
- dataDir - The directory where the zookeeper data is stored.
- clientPort - The port used to communicate with clients.
- tickTime - The duration of a tick in milliseconds. This is the basic
unit of time in zookeeper.
- initLimit - The maximum number of ticks that a follower will wait to
initially synchronize with a leader.
- syncLimit - The maximum number of ticks that a follower will wait for a
message (including heartbeats) from the leader.
- 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.
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)
|
QuorumPeerMain
public QuorumPeerMain()
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