|
@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
|
|
<div class="menupage">
|
|
<div class="menupage">
|
|
<div class="menupagetitle">Administrator's Guide</div>
|
|
<div class="menupagetitle">Administrator's Guide</div>
|
|
</div>
|
|
</div>
|
|
|
|
+<div class="menuitem">
|
|
|
|
+<a href="zookeeperJMX.html">JMX</a>
|
|
|
|
+</div>
|
|
</div>
|
|
</div>
|
|
<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
|
|
<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
|
|
<div id="menu_1.4" class="menuitemgroup">
|
|
<div id="menu_1.4" class="menuitemgroup">
|
|
@@ -476,14 +479,30 @@ server.3=zoo3:2888:3888</span>
|
|
|
|
|
|
<li>
|
|
<li>
|
|
|
|
|
|
-<p>If your configuration file is set up, you can start
|
|
|
|
- ZooKeeper:</p>
|
|
|
|
|
|
+<p>If your configuration file is set up, you can start a
|
|
|
|
+ ZooKeeper server:</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
<p>
|
|
-<span class="codefrag computeroutput">$ java -cp zookeeper.jar:src/java/lib/log4j-1.2.15.jar:conf \
|
|
|
|
- org.apache.zookeeper.server.quorum.ManagedQuorumPeerMain zoo.cfg</span>
|
|
|
|
|
|
+<span class="codefrag computeroutput">$ java -cp zookeeper.jar:lib/log4j-1.2.15.jar:conf \
|
|
|
|
+ org.apache.zookeeper.server.quorum.QuorumPeerMain zoo.cfg
|
|
|
|
+ </span>
|
|
</p>
|
|
</p>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+<p>QuorumPeerMain starts a ZooKeeper server,
|
|
|
|
+ <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</a>
|
|
|
|
+ management beans are also registered which allows
|
|
|
|
+ management through a JMX management console.
|
|
|
|
+ The <a href="zookeeperJMX.html">ZooKeeper JMX
|
|
|
|
+ document</a> contains details on managing ZooKeeper with JMX.
|
|
|
|
+ </p>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+<p>See the script <em>bin/zkServer.sh</em>,
|
|
|
|
+ which is included in the release, for an example
|
|
|
|
+ of starting server instances.</p>
|
|
|
|
+
|
|
|
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
@@ -546,7 +565,7 @@ server.3=zoo3:2888:3888</span>
|
|
</li>
|
|
</li>
|
|
|
|
|
|
</ol>
|
|
</ol>
|
|
-<a name="N10108"></a><a name="sc_singleAndDevSetup"></a>
|
|
|
|
|
|
+<a name="N10119"></a><a name="sc_singleAndDevSetup"></a>
|
|
<h3 class="h4">Single Server and Developer Setup</h3>
|
|
<h3 class="h4">Single Server and Developer Setup</h3>
|
|
<p>If you want to setup ZooKeeper for development purposes, you will
|
|
<p>If you want to setup ZooKeeper for development purposes, you will
|
|
probably want to setup a single server instance of ZooKeeper, and then
|
|
probably want to setup a single server instance of ZooKeeper, and then
|
|
@@ -564,7 +583,7 @@ server.3=zoo3:2888:3888</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
-<a name="N10129"></a><a name="ch_administration"></a>
|
|
|
|
|
|
+<a name="N1013A"></a><a name="ch_administration"></a>
|
|
<h2 class="h3">Administration</h2>
|
|
<h2 class="h3">Administration</h2>
|
|
<div class="section">
|
|
<div class="section">
|
|
<p>This section contains information about running and maintaining
|
|
<p>This section contains information about running and maintaining
|
|
@@ -679,7 +698,7 @@ server.3=zoo3:2888:3888</span>
|
|
</li>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</ul>
|
|
-<a name="N10195"></a><a name="sc_designing"></a>
|
|
|
|
|
|
+<a name="N101A6"></a><a name="sc_designing"></a>
|
|
<h3 class="h4">Designing a ZooKeeper Deployment</h3>
|
|
<h3 class="h4">Designing a ZooKeeper Deployment</h3>
|
|
<p>The reliablity of ZooKeeper rests on two basic assumptions.</p>
|
|
<p>The reliablity of ZooKeeper rests on two basic assumptions.</p>
|
|
<ol>
|
|
<ol>
|
|
@@ -706,7 +725,7 @@ server.3=zoo3:2888:3888</span>
|
|
to hold true. Some of these are cross-machines considerations,
|
|
to hold true. Some of these are cross-machines considerations,
|
|
and others are things you should consider for each and every
|
|
and others are things you should consider for each and every
|
|
machine in your deployment.</p>
|
|
machine in your deployment.</p>
|
|
-<a name="N101B1"></a><a name="sc_CrossMachineRequirements"></a>
|
|
|
|
|
|
+<a name="N101C2"></a><a name="sc_CrossMachineRequirements"></a>
|
|
<h4>Cross Machine Requirements</h4>
|
|
<h4>Cross Machine Requirements</h4>
|
|
<p>For the ZooKeeper service to be active, there must be a
|
|
<p>For the ZooKeeper service to be active, there must be a
|
|
majority of non-failing machines that can communicate with
|
|
majority of non-failing machines that can communicate with
|
|
@@ -724,7 +743,7 @@ server.3=zoo3:2888:3888</span>
|
|
failure of that switch could cause a correlated failure and
|
|
failure of that switch could cause a correlated failure and
|
|
bring down the service. The same holds true of shared power
|
|
bring down the service. The same holds true of shared power
|
|
circuits, cooling systems, etc.</p>
|
|
circuits, cooling systems, etc.</p>
|
|
-<a name="N101BE"></a><a name="Single+Machine+Requirements"></a>
|
|
|
|
|
|
+<a name="N101CF"></a><a name="Single+Machine+Requirements"></a>
|
|
<h4>Single Machine Requirements</h4>
|
|
<h4>Single Machine Requirements</h4>
|
|
<p>If ZooKeeper has to contend with other applications for
|
|
<p>If ZooKeeper has to contend with other applications for
|
|
access to resourses like storage media, CPU, network, or
|
|
access to resourses like storage media, CPU, network, or
|
|
@@ -765,19 +784,19 @@ server.3=zoo3:2888:3888</span>
|
|
</li>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</ul>
|
|
-<a name="N101DC"></a><a name="sc_provisioning"></a>
|
|
|
|
|
|
+<a name="N101ED"></a><a name="sc_provisioning"></a>
|
|
<h3 class="h4">Provisioning</h3>
|
|
<h3 class="h4">Provisioning</h3>
|
|
<p></p>
|
|
<p></p>
|
|
-<a name="N101E5"></a><a name="sc_strengthsAndLimitations"></a>
|
|
|
|
|
|
+<a name="N101F6"></a><a name="sc_strengthsAndLimitations"></a>
|
|
<h3 class="h4">Things to Consider: ZooKeeper Strengths and Limitations</h3>
|
|
<h3 class="h4">Things to Consider: ZooKeeper Strengths and Limitations</h3>
|
|
<p></p>
|
|
<p></p>
|
|
-<a name="N101EE"></a><a name="sc_administering"></a>
|
|
|
|
|
|
+<a name="N101FF"></a><a name="sc_administering"></a>
|
|
<h3 class="h4">Administering</h3>
|
|
<h3 class="h4">Administering</h3>
|
|
<p></p>
|
|
<p></p>
|
|
-<a name="N101F7"></a><a name="sc_monitoring"></a>
|
|
|
|
|
|
+<a name="N10208"></a><a name="sc_monitoring"></a>
|
|
<h3 class="h4">Monitoring</h3>
|
|
<h3 class="h4">Monitoring</h3>
|
|
<p></p>
|
|
<p></p>
|
|
-<a name="N10200"></a><a name="sc_logging"></a>
|
|
|
|
|
|
+<a name="N10211"></a><a name="sc_logging"></a>
|
|
<h3 class="h4">Logging</h3>
|
|
<h3 class="h4">Logging</h3>
|
|
<p>ZooKeeper uses <strong>log4j</strong> version 1.2 as
|
|
<p>ZooKeeper uses <strong>log4j</strong> version 1.2 as
|
|
its logging infrastructure. The ZooKeeper default <span class="codefrag filename">log4j.properties</span>
|
|
its logging infrastructure. The ZooKeeper default <span class="codefrag filename">log4j.properties</span>
|
|
@@ -787,10 +806,10 @@ server.3=zoo3:2888:3888</span>
|
|
<p>For more information, see
|
|
<p>For more information, see
|
|
<a href="http://logging.apache.org/log4j/1.2/manual.html#defaultInit">Log4j Default Initialization Procedure</a>
|
|
<a href="http://logging.apache.org/log4j/1.2/manual.html#defaultInit">Log4j Default Initialization Procedure</a>
|
|
of the log4j manual.</p>
|
|
of the log4j manual.</p>
|
|
-<a name="N10220"></a><a name="sc_troubleshooting"></a>
|
|
|
|
|
|
+<a name="N10231"></a><a name="sc_troubleshooting"></a>
|
|
<h3 class="h4">Troubleshooting</h3>
|
|
<h3 class="h4">Troubleshooting</h3>
|
|
<p></p>
|
|
<p></p>
|
|
-<a name="N10229"></a><a name="sc_configuration"></a>
|
|
|
|
|
|
+<a name="N1023A"></a><a name="sc_configuration"></a>
|
|
<h3 class="h4">Configuration Parameters</h3>
|
|
<h3 class="h4">Configuration Parameters</h3>
|
|
<p>ZooKeeper's behavior is governed by the ZooKeeper configuration
|
|
<p>ZooKeeper's behavior is governed by the ZooKeeper configuration
|
|
file. This file is designed so that the exact same file can be used by
|
|
file. This file is designed so that the exact same file can be used by
|
|
@@ -798,7 +817,7 @@ server.3=zoo3:2888:3888</span>
|
|
layouts are the same. If servers use different configuration files, care
|
|
layouts are the same. If servers use different configuration files, care
|
|
must be taken to ensure that the list of servers in all of the different
|
|
must be taken to ensure that the list of servers in all of the different
|
|
configuration files match.</p>
|
|
configuration files match.</p>
|
|
-<a name="N10232"></a><a name="sc_minimumConfiguration"></a>
|
|
|
|
|
|
+<a name="N10243"></a><a name="sc_minimumConfiguration"></a>
|
|
<h4>Minimum Configuration</h4>
|
|
<h4>Minimum Configuration</h4>
|
|
<p>Here are the minimum configuration keywords that must be defined
|
|
<p>Here are the minimum configuration keywords that must be defined
|
|
in the configuration file:</p>
|
|
in the configuration file:</p>
|
|
@@ -845,7 +864,7 @@ server.3=zoo3:2888:3888</span>
|
|
</dd>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
</dl>
|
|
-<a name="N10259"></a><a name="sc_advancedConfiguration"></a>
|
|
|
|
|
|
+<a name="N1026A"></a><a name="sc_advancedConfiguration"></a>
|
|
<h4>Advanced Configuration</h4>
|
|
<h4>Advanced Configuration</h4>
|
|
<p>The configuration settings in the section are optional. You can
|
|
<p>The configuration settings in the section are optional. You can
|
|
use them to further fine tune the behaviour of your ZooKeeper servers.
|
|
use them to further fine tune the behaviour of your ZooKeeper servers.
|
|
@@ -936,7 +955,7 @@ server.3=zoo3:2888:3888</span>
|
|
</dd>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
</dl>
|
|
-<a name="N102B9"></a><a name="sc_clusterOptions"></a>
|
|
|
|
|
|
+<a name="N102CA"></a><a name="sc_clusterOptions"></a>
|
|
<h4>Cluster Options</h4>
|
|
<h4>Cluster Options</h4>
|
|
<p>The options in this section are designed for use with an ensemble
|
|
<p>The options in this section are designed for use with an ensemble
|
|
of servers -- that is, when deploying clusters of servers.</p>
|
|
of servers -- that is, when deploying clusters of servers.</p>
|
|
@@ -1026,7 +1045,7 @@ server.3=zoo3:2888:3888</span>
|
|
|
|
|
|
</dl>
|
|
</dl>
|
|
<p></p>
|
|
<p></p>
|
|
-<a name="N10316"></a><a name="Unsafe+Options"></a>
|
|
|
|
|
|
+<a name="N10327"></a><a name="Unsafe+Options"></a>
|
|
<h4>Unsafe Options</h4>
|
|
<h4>Unsafe Options</h4>
|
|
<p>The following options can be useful, but be careful when you use
|
|
<p>The following options can be useful, but be careful when you use
|
|
them. The risk of each is explained along with the explanation of what
|
|
them. The risk of each is explained along with the explanation of what
|
|
@@ -1071,7 +1090,7 @@ server.3=zoo3:2888:3888</span>
|
|
</dd>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
</dl>
|
|
-<a name="N10348"></a><a name="sc_zkCommands"></a>
|
|
|
|
|
|
+<a name="N10359"></a><a name="sc_zkCommands"></a>
|
|
<h3 class="h4">ZooKeeper Commands: The Four Letter Words</h3>
|
|
<h3 class="h4">ZooKeeper Commands: The Four Letter Words</h3>
|
|
<p>ZooKeeper responds to a small set of commands. Each command is
|
|
<p>ZooKeeper responds to a small set of commands. Each command is
|
|
composed of four letters. You issue the commands to ZooKeeper via telnet
|
|
composed of four letters. You issue the commands to ZooKeeper via telnet
|
|
@@ -1144,7 +1163,7 @@ server.3=zoo3:2888:3888</span>
|
|
<pre class="code">$ echo ruok | nc 127.0.0.1 5111
|
|
<pre class="code">$ echo ruok | nc 127.0.0.1 5111
|
|
imok
|
|
imok
|
|
</pre>
|
|
</pre>
|
|
-<a name="N1038F"></a><a name="sc_dataFileManagement"></a>
|
|
|
|
|
|
+<a name="N103A0"></a><a name="sc_dataFileManagement"></a>
|
|
<h3 class="h4">Data File Management</h3>
|
|
<h3 class="h4">Data File Management</h3>
|
|
<p>ZooKeeper stores its data in a data directory and its transaction
|
|
<p>ZooKeeper stores its data in a data directory and its transaction
|
|
log in a transaction log directory. By default these two directories are
|
|
log in a transaction log directory. By default these two directories are
|
|
@@ -1152,7 +1171,7 @@ imok
|
|
transaction log files in a separate directory than the data files.
|
|
transaction log files in a separate directory than the data files.
|
|
Throughput increases and latency decreases when transaction logs reside
|
|
Throughput increases and latency decreases when transaction logs reside
|
|
on a dedicated log devices.</p>
|
|
on a dedicated log devices.</p>
|
|
-<a name="N10398"></a><a name="The+Data+Directory"></a>
|
|
|
|
|
|
+<a name="N103A9"></a><a name="The+Data+Directory"></a>
|
|
<h4>The Data Directory</h4>
|
|
<h4>The Data Directory</h4>
|
|
<p>This directory has two files in it:</p>
|
|
<p>This directory has two files in it:</p>
|
|
<ul>
|
|
<ul>
|
|
@@ -1198,14 +1217,14 @@ imok
|
|
idempotent nature of its updates. By replaying the transaction log
|
|
idempotent nature of its updates. By replaying the transaction log
|
|
against fuzzy snapshots ZooKeeper gets the state of the system at the
|
|
against fuzzy snapshots ZooKeeper gets the state of the system at the
|
|
end of the log.</p>
|
|
end of the log.</p>
|
|
-<a name="N103D4"></a><a name="The+Log+Directory"></a>
|
|
|
|
|
|
+<a name="N103E5"></a><a name="The+Log+Directory"></a>
|
|
<h4>The Log Directory</h4>
|
|
<h4>The Log Directory</h4>
|
|
<p>The Log Directory contains the ZooKeeper transaction logs.
|
|
<p>The Log Directory contains the ZooKeeper transaction logs.
|
|
Before any update takes place, ZooKeeper ensures that the transaction
|
|
Before any update takes place, ZooKeeper ensures that the transaction
|
|
that represents the update is written to non-volatile storage. A new
|
|
that represents the update is written to non-volatile storage. A new
|
|
log file is started each time a snapshot is begun. The log file's
|
|
log file is started each time a snapshot is begun. The log file's
|
|
suffix is the first zxid written to that log.</p>
|
|
suffix is the first zxid written to that log.</p>
|
|
-<a name="N103DE"></a><a name="File+Management"></a>
|
|
|
|
|
|
+<a name="N103EF"></a><a name="File+Management"></a>
|
|
<h4>File Management</h4>
|
|
<h4>File Management</h4>
|
|
<p>The format of snapshot and log files does not change between
|
|
<p>The format of snapshot and log files does not change between
|
|
standalone ZooKeeper servers and different configurations of
|
|
standalone ZooKeeper servers and different configurations of
|
|
@@ -1222,7 +1241,7 @@ imok
|
|
needs the latest complete fuzzy snapshot and the log files from the
|
|
needs the latest complete fuzzy snapshot and the log files from the
|
|
start of that snapshot. The PurgeTxnLog utility implements a simple
|
|
start of that snapshot. The PurgeTxnLog utility implements a simple
|
|
retention policy that administrators can use.</p>
|
|
retention policy that administrators can use.</p>
|
|
-<a name="N103EF"></a><a name="sc_commonProblems"></a>
|
|
|
|
|
|
+<a name="N10400"></a><a name="sc_commonProblems"></a>
|
|
<h3 class="h4">Things to Avoid</h3>
|
|
<h3 class="h4">Things to Avoid</h3>
|
|
<p>Here are some common problems you can avoid by configuring
|
|
<p>Here are some common problems you can avoid by configuring
|
|
ZooKeeper correctly:</p>
|
|
ZooKeeper correctly:</p>
|
|
@@ -1276,7 +1295,7 @@ imok
|
|
</dd>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
</dl>
|
|
-<a name="N10413"></a><a name="sc_bestPractices"></a>
|
|
|
|
|
|
+<a name="N10424"></a><a name="sc_bestPractices"></a>
|
|
<h3 class="h4">Best Practices</h3>
|
|
<h3 class="h4">Best Practices</h3>
|
|
<p>For best results, take note of the following list of good
|
|
<p>For best results, take note of the following list of good
|
|
Zookeeper practices. <em>[tbd...]</em>
|
|
Zookeeper practices. <em>[tbd...]</em>
|