|
@@ -1259,30 +1259,45 @@ server.3=zoo3:2888:3888</span>
|
|
|
<p>ZooKeeper responds to a small set of commands. Each command is
|
|
|
composed of four letters. You issue the commands to ZooKeeper via telnet
|
|
|
or nc, at the client port.</p>
|
|
|
+<p>Three of the more interesting commands: "stat" gives some
|
|
|
+ general information about the server and connected clients,
|
|
|
+ while "srvr" and "cons" give extended details on server and
|
|
|
+ connections respectively.</p>
|
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
|
-<term>dump</term>
|
|
|
+<term>cons</term>
|
|
|
</dt>
|
|
|
<dd>
|
|
|
-<p>Lists the outstanding sessions and ephemeral nodes. This
|
|
|
- only works on the leader.</p>
|
|
|
+<p>List full connection/session details for all clients
|
|
|
+ connected to this server. Includes information on numbers
|
|
|
+ of packets received/sent, session id, operation latencies,
|
|
|
+ last operation performed, etc...</p>
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
<dt>
|
|
|
-<term>envi</term>
|
|
|
+<term>crst</term>
|
|
|
</dt>
|
|
|
<dd>
|
|
|
-<p>Print details about serving environment</p>
|
|
|
+<p>Reset connection/session statistics for all connections.</p>
|
|
|
+</dd>
|
|
|
+
|
|
|
+
|
|
|
+<dt>
|
|
|
+<term>dump</term>
|
|
|
+</dt>
|
|
|
+<dd>
|
|
|
+<p>Lists the outstanding sessions and ephemeral nodes. This
|
|
|
+ only works on the leader.</p>
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
<dt>
|
|
|
-<term>reqs</term>
|
|
|
+<term>envi</term>
|
|
|
</dt>
|
|
|
<dd>
|
|
|
-<p>List outstanding requests</p>
|
|
|
+<p>Print details about serving environment</p>
|
|
|
</dd>
|
|
|
|
|
|
|
|
@@ -1300,7 +1315,15 @@ server.3=zoo3:2888:3888</span>
|
|
|
<term>srst</term>
|
|
|
</dt>
|
|
|
<dd>
|
|
|
-<p>Reset statistics returned by stat command.</p>
|
|
|
+<p>Reset server statistics.</p>
|
|
|
+</dd>
|
|
|
+
|
|
|
+
|
|
|
+<dt>
|
|
|
+<term>srvr</term>
|
|
|
+</dt>
|
|
|
+<dd>
|
|
|
+<p>Lists full details for the server.</p>
|
|
|
</dd>
|
|
|
|
|
|
|
|
@@ -1308,7 +1331,7 @@ server.3=zoo3:2888:3888</span>
|
|
|
<term>stat</term>
|
|
|
</dt>
|
|
|
<dd>
|
|
|
-<p>Lists statistics about performance and connected
|
|
|
+<p>Lists brief details for the server and connected
|
|
|
clients.</p>
|
|
|
</dd>
|
|
|
|
|
@@ -1318,7 +1341,7 @@ server.3=zoo3:2888:3888</span>
|
|
|
<pre class="code">$ echo ruok | nc 127.0.0.1 5111
|
|
|
imok
|
|
|
</pre>
|
|
|
-<a name="N10424"></a><a name="sc_dataFileManagement"></a>
|
|
|
+<a name="N10435"></a><a name="sc_dataFileManagement"></a>
|
|
|
<h3 class="h4">Data File Management</h3>
|
|
|
<p>ZooKeeper stores its data in a data directory and its transaction
|
|
|
log in a transaction log directory. By default these two directories are
|
|
@@ -1326,7 +1349,7 @@ imok
|
|
|
transaction log files in a separate directory than the data files.
|
|
|
Throughput increases and latency decreases when transaction logs reside
|
|
|
on a dedicated log devices.</p>
|
|
|
-<a name="N1042D"></a><a name="The+Data+Directory"></a>
|
|
|
+<a name="N1043E"></a><a name="The+Data+Directory"></a>
|
|
|
<h4>The Data Directory</h4>
|
|
|
<p>This directory has two files in it:</p>
|
|
|
<ul>
|
|
@@ -1372,14 +1395,14 @@ imok
|
|
|
idempotent nature of its updates. By replaying the transaction log
|
|
|
against fuzzy snapshots ZooKeeper gets the state of the system at the
|
|
|
end of the log.</p>
|
|
|
-<a name="N10469"></a><a name="The+Log+Directory"></a>
|
|
|
+<a name="N1047A"></a><a name="The+Log+Directory"></a>
|
|
|
<h4>The Log Directory</h4>
|
|
|
<p>The Log Directory contains the ZooKeeper transaction logs.
|
|
|
Before any update takes place, ZooKeeper ensures that the transaction
|
|
|
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
|
|
|
suffix is the first zxid written to that log.</p>
|
|
|
-<a name="N10473"></a><a name="sc_filemanagement"></a>
|
|
|
+<a name="N10484"></a><a name="sc_filemanagement"></a>
|
|
|
<h4>File Management</h4>
|
|
|
<p>The format of snapshot and log files does not change between
|
|
|
standalone ZooKeeper servers and different configurations of
|
|
@@ -1399,7 +1422,7 @@ imok
|
|
|
this document for more details on setting a retention policy
|
|
|
and maintenance of ZooKeeper storage.
|
|
|
</p>
|
|
|
-<a name="N10488"></a><a name="sc_commonProblems"></a>
|
|
|
+<a name="N10499"></a><a name="sc_commonProblems"></a>
|
|
|
<h3 class="h4">Things to Avoid</h3>
|
|
|
<p>Here are some common problems you can avoid by configuring
|
|
|
ZooKeeper correctly:</p>
|
|
@@ -1453,7 +1476,7 @@ imok
|
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
-<a name="N104AC"></a><a name="sc_bestPractices"></a>
|
|
|
+<a name="N104BD"></a><a name="sc_bestPractices"></a>
|
|
|
<h3 class="h4">Best Practices</h3>
|
|
|
<p>For best results, take note of the following list of good
|
|
|
Zookeeper practices:</p>
|