Class QuorumPeerMain
- java.lang.Object
-
- org.apache.zookeeper.server.quorum.QuorumPeerMain
-
@Public public class QuorumPeerMain extends java.lang.Object
Configuration file
When the main() method of this class is used to start the program, the first argument is used as a path to the config file, which will be used to obtain configuration information. This file is a Properties file, so keys and values are separated by equals (=) and the key/value pairs are separated by new lines. The following is a general summary of keys used in the configuration file. For full details on this see the documentation in docs/index.html- dataDir - The directory where the ZooKeeper data is stored.
- dataLogDir - The directory where the ZooKeeper transaction log 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[:port] that the server with the given id will use for the quorum protocol.
-
-
Field Summary
Fields Modifier and Type Field Description protected QuorumPeer
quorumPeer
-
Constructor Summary
Constructors Constructor Description QuorumPeerMain()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Shutdowns properly the service, this method is not a public API.protected QuorumPeer
getQuorumPeer()
protected void
initializeAndRun(java.lang.String[] args)
static void
main(java.lang.String[] args)
To start the replicated server specify the configuration file name on the command line.void
runFromConfig(QuorumPeerConfig config)
java.lang.String
toString()
-
-
-
Field Detail
-
quorumPeer
protected QuorumPeer quorumPeer
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
To start the replicated server specify the configuration file name on the command line.- Parameters:
args
- path to the configfile
-
initializeAndRun
protected void initializeAndRun(java.lang.String[] args) throws QuorumPeerConfig.ConfigException, java.io.IOException, AdminServer.AdminServerException
- Throws:
QuorumPeerConfig.ConfigException
java.io.IOException
AdminServer.AdminServerException
-
runFromConfig
public void runFromConfig(QuorumPeerConfig config) throws java.io.IOException, AdminServer.AdminServerException
- Throws:
java.io.IOException
AdminServer.AdminServerException
-
getQuorumPeer
protected QuorumPeer getQuorumPeer() throws javax.security.sasl.SaslException
- Throws:
javax.security.sasl.SaslException
-
close
public void close()
Shutdowns properly the service, this method is not a public API.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-