浏览代码

ZOOKEEPER-177. needed: docs for JMX (phunt via mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@738323 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 16 年之前
父节点
当前提交
8246ad6559

+ 2 - 0
CHANGES.txt

@@ -118,6 +118,8 @@ IMPROVEMENTS:
    and messages generated. (phunt via breed)
 
    ZOOKEEPER-210. Require Java 6. (phunt via breed)
+    
+   ZOOKEEPER-177.  needed: docs for JMX (phunt via mahadev)
 
 Release 3.0.0 - 2008-10-21
 

+ 17 - 3
bin/zkServer.sh

@@ -21,13 +21,27 @@
 # relative to the canonical path of this script.
 #
 
-# by default we allow non-local JMX connection
-# set this to true if you wish to allow only local connections
+# See the following page for extensive details on setting
+# up the JVM to accept JMX remote management:
+# http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
+# by default we allow local JMX connections
 if [ "x$JMXLOCALONLY" = "x" ]
 then 
     JMXLOCALONLY=false
 fi
 
+if [ "x$JMXDISABLE" = "x" ]
+then
+    echo "JMX enabled by default"
+    # for some reason these two options are necessary on jdk6 on Ubuntu
+    #   accord to the docs they are not necessary, but otw jconsole cannot
+    #   do a local attach
+    ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLY org.apache.zookeeper.server.quorum.QuorumPeerMain"
+else
+    echo "JMX disabled by user request"
+    ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
+fi
+
 ZOOBIN=`readlink -f "$0"`
 ZOOBINDIR=`dirname "$ZOOBIN"`
 
@@ -37,7 +51,7 @@ case $1 in
 start) 
     echo -n "Starting zookeeper ... "
     java  "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
-    -cp $CLASSPATH -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLY $JVMFLAGS org.apache.zookeeper.server.quorum.ManagedQuorumPeerMain $ZOOCFG &
+    -cp $CLASSPATH $JVMFLAGS $ZOOMAIN $ZOOCFG &
     echo STARTED
     ;;
 stop) 

+ 21 - 11
docs/index.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">
@@ -183,18 +186,22 @@ document.write("Last Published: " + document.lastModified);
 </div>
 <h1>ZooKeeper: Because Coordinating Distributed Systems is a Zoo</h1>
     
-<p>
-ZooKeeper is a high-performance coordination service for distributed applications. 
-It exposes common services - such as naming, configuration management, synchronization, 
-and group services - in a simple interface so you don't have to write them from scratch. 
-You can use it off-the-shelf to implement consensus, group management, leader election, 
-and presence protocols. And you can build on it for your own, specific needs.
-</p>
-
+<p>ZooKeeper is a high-performance coordination service for
+      distributed applications.  It exposes common services - such as
+      naming, configuration management, synchronization, and group
+      services - in a simple interface so you don't have to write them
+      from scratch.  You can use it off-the-shelf to implement
+      consensus, group management, leader election, and presence
+      protocols. And you can build on it for your own, specific needs.
+    </p>
 
+    
 <p>
-The following documents describe concepts and procedures to get you started using ZooKeeper. If you have more questions, please ask the <a href="http://hadoop.apache.org/zookeeper/mailing_lists.html">mailing list</a> or browse the archives.
-</p>
+      The following documents describe concepts and procedures to get
+      you started using ZooKeeper. If you have more questions, please
+      ask the <a href="http://hadoop.apache.org/zookeeper/mailing_lists.html">mailing list</a> or browse the
+      archives.
+    </p>
     
 <ul>
 
@@ -251,7 +258,10 @@ The following documents describe concepts and procedures to get you started usin
 <ul>
       
 <li>
-<a href="zookeeperAdmin.html">Administrator's Guide</a> - a guide for system administrators and anyone else who might deploy Zookeeer</li>
+<a href="zookeeperAdmin.html">Administrator's Guide</a> - a guide for system administrators and anyone else who might deploy ZooKeeper</li>
+      
+<li>
+<a href="zookeeperJMX.html">JMX</a> - how to enable JMX in ZooKeeper</li>
       
 </ul>
       

文件差异内容过多而无法显示
+ 1 - 1
docs/index.pdf


+ 3 - 0
docs/javaExample.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">

+ 9 - 0
docs/linkmap.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">
@@ -274,6 +277,12 @@ document.write("Last Published: " + document.lastModified);
 <a href="zookeeperAdmin.html">Administrator's Guide</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>admin</em>
 </li>
 </ul>
+      
+<ul>
+<li>
+<a href="zookeeperJMX.html">JMX</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>jmx</em>
+</li>
+</ul>
   
 </ul>
 </ul>

+ 12 - 12
docs/linkmap.pdf

@@ -5,10 +5,10 @@
 /Producer (FOP 0.20.5) >>
 endobj
 5 0 obj
-<< /Length 1065 /Filter [ /ASCII85Decode /FlateDecode ]
+<< /Length 1087 /Filter [ /ASCII85Decode /FlateDecode ]
  >>
 stream
-Gau0C>>O!-(k(kVaO:>(o5)ImjcTFJ0Q*.&D+p.-?1:DFi4-T%r>Z&u%5Y!3Xd*'sP]Ml"I)kri3?EV(N?_*sN5i19D#Pb+(gW+t"O.`OGr(`t#i[+f`q/Ekg:>RX4o0]Xbfm./MXkB)Wbu4g/dl;ucFW_8/2])']cR-.`Wq6d7L6KI*Z[sRO?h7BNNYe,5gX+Tc#'eiq5BtR[$5E3?h:EVOn5U2g)6lDgLK?p@F>WcXjpmT(Q*iXm3nWujrhtk[9m<8hcMF]9iu'1!I7l9-T76q=UTqLpugth1LTb\&>ofp3VFWN224QXU_,m(^sJ;D!MO],a*1eE$%>*<<K'feUVu>_b/mk5J<FMp@e1O8op$?UIIb4K.'i<`UUYfjm*c+maSo8JB\Z)#jcIf]4j$;2GLh&5Cl`?`b,[.qcS\Xi:BrC-Y0QXWkH(:0qh-;l9@4PBcZm9/m25GQe@ZhTPLtD3N/AE_$ef)!6>4^_g\d'JZJoW/1RcS*k?,kDUsTrS[;iM07;gkS%F%:WG8$$r<MEh@9S2st;=[>aq4+M[cMkDa&C\Hr-BJ9sLeh6_4M=qY/.EN[JDE4ubg$<+NfW.5M!]rW&cONo3tM96P:UC59r=/Z.JUANlu^&[Nfh<h/X9__i)%H#^rGr:TM).5DZ;I_*q[kuT874cPEXY]W^ibS0RGo'a"ZkWl!0HY!8hqDj(c*X34"8ZnP[Af&I_jd8epKg_T^3uGO@3g,g1RIejcJ`XuJp;D`)`),qdrb)&U?5IEA6e.Z2l'1$#6N;L[c@EZMQ+Y-"^7`SgK-\3QVsT3$-5I;q)FJrjo26p9Kt_+H<r/*(1M@SD0DjWYS+n-r+ILuF6L9D!Q=f;Ak9TKdTY:03\?K$W(dY8WYSTE1(?.(n<eTs="mQQ/qtR5<3"/6YI=d*?lXCC<4.V').WPX`SH6\&mHGVgA1N]*AY&=[t7=:f((-.Jn!&Z$h>Bp?YgVCg&YXF;[>Ffi8JmfHG;oe;&e;]oC.jl&\J->rigcLa7ucH*.nPZ+H5/:mCp;03i%>s!I@S(f]jJo9h&!<3ph/-~>
+Gau0C?#pZ&'Re<2fI*d37:9Og*rBf^<GOCcUNIQFO9E0u<gGT=mq(1L$WXd/N@$FfYd<L40)#?iIlr%&*(Q@r(l`/Qf_eH50Ue&!"O.`OGr(`t#i[+f`lmShcDAnc7C8!%bWOQ='BRK%<SbHX>o1e-3U>B(ZIHP:oo&$L1k';/BnUHKm*X3;"UQG+h0:+.#(ea/G2,"ARWf+m:.s9Kon%CYM-O'bf?Qo=g`@uD%[2(7C9:MM]i#j*CI\Em1^A;LVu6s4qT*1ZCr/LP#fpVdYLlgsAhFd$ibs<qmK&M9!-*l]SmrkJSRYb):)X]I!=V-E]*Pg.Is9)dXl/N=Wa_3E(aVAd<)+LX"-bVE'V"!1WfOeHlcBBiU<'L$8$UoYp?@/GAH+/`1iB)MEl`US*b?UT46o"*G/CX&jh/e%9?i^`e%nY9X7JID3U7,dT?r75.Jc<n#@;@M42uXu26VeY,W;;:UZ+_qK(^%6&/mCF+i!,mXLK2:N+TEc3M'aidV'#eg3\>'7IJNs%F%:WG8$$r<MEh@9S2t_YN/rnjcZ\-cMi-q'%=Zt-BJ9sLeh6_4M=qY/.EN[27n"VR%p:T3Bi1q+gr>M8,1mo*<#4?R:JUilnbJk9u4T8@M^Q/Ef;h]BrM4c#)>67!&g/;"C3fpEVlY"nt;=5n;4*P0KFu,Y'LdsKA#;T3/1j#9p_U@!r/j4^8m!hNAF5k&O4D40nM],=fK8C<L?pJJ*/F?5dJUHAo1Ln`8Vbj]lj<gGkBo]nF+Oj9k7<C)ZtggeD*`_\8JWtTW5V0d\D*9RUU?tLMZK`au>hlY.mcW-!HS8(n?"D*QSoRo84$c09.an]&d2H'4)BSjDqY^4)tmBiY+I,P)'7snPS(t/Mk[@?X(#]4Xd3o"!$c8Ca[7*T<TL:C=4A@J9*%Emr!A^2NfYp>c(ga-aLcp[#"FPU[dQ'/Mh7gKO>-b)A1.$!N)"=d;3nZg2G,4Cn?9knhe65Th]`f-oIttUHA`;D.sJjoh1/;6?dS8'rIqq@0eZe>[9>.l<_FVDZ<V[oU74AjB/S-.FUVL^j3%1\rPmTSNa7%h47>-2tc(@KVLR~>
 endstream
 endobj
 6 0 obj
@@ -72,17 +72,17 @@ endobj
 xref
 0 12
 0000000000 65535 f 
-0000001889 00000 n 
-0000001947 00000 n 
-0000001997 00000 n 
+0000001911 00000 n 
+0000001969 00000 n 
+0000002019 00000 n 
 0000000015 00000 n 
 0000000071 00000 n 
-0000001228 00000 n 
-0000001334 00000 n 
-0000001446 00000 n 
-0000001555 00000 n 
-0000001665 00000 n 
-0000001773 00000 n 
+0000001250 00000 n 
+0000001356 00000 n 
+0000001468 00000 n 
+0000001577 00000 n 
+0000001687 00000 n 
+0000001795 00000 n 
 trailer
 <<
 /Size 12
@@ -90,5 +90,5 @@ trailer
 /Info 4 0 R
 >>
 startxref
-2117
+2139
 %%EOF

+ 3 - 0
docs/recipes.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">

+ 3 - 0
docs/releasenotes.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">

+ 46 - 27
docs/zookeeperAdmin.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menupage">
 <div class="menupagetitle">Administrator's Guide</div>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">
@@ -476,14 +479,30 @@ server.3=zoo3:2888:3888</span>
         
 <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>
-<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>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>
 
@@ -546,7 +565,7 @@ server.3=zoo3:2888:3888</span>
 </li>
       
 </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>
 <p>If you want to setup ZooKeeper for development purposes, you will
       probably want to setup a single server instance of ZooKeeper, and then
@@ -564,7 +583,7 @@ server.3=zoo3:2888:3888</span>
 </div>
 
   
-<a name="N10129"></a><a name="ch_administration"></a>
+<a name="N1013A"></a><a name="ch_administration"></a>
 <h2 class="h3">Administration</h2>
 <div class="section">
 <p>This section contains information about running and maintaining
@@ -679,7 +698,7 @@ server.3=zoo3:2888:3888</span>
 </li>
       
 </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>
 <p>The reliablity of ZooKeeper rests on two basic assumptions.</p>
 <ol>
@@ -706,7 +725,7 @@ server.3=zoo3:2888:3888</span>
       to hold true. Some of these are cross-machines considerations,
       and others are things you should consider for each and every
       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>
 <p>For the ZooKeeper service to be active, there must be a
         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
         bring down the service. The same holds true of shared power
         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>
 <p>If ZooKeeper has to contend with other applications for
         access to resourses like storage media, CPU, network, or
@@ -765,19 +784,19 @@ server.3=zoo3:2888:3888</span>
 </li>
       
 </ul>
-<a name="N101DC"></a><a name="sc_provisioning"></a>
+<a name="N101ED"></a><a name="sc_provisioning"></a>
 <h3 class="h4">Provisioning</h3>
 <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>
 <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>
 <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>
 <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>
 <p>ZooKeeper uses <strong>log4j</strong> version 1.2 as 
       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 
       <a href="http://logging.apache.org/log4j/1.2/manual.html#defaultInit">Log4j Default Initialization Procedure</a> 
       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>
 <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>
 <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
@@ -798,7 +817,7 @@ server.3=zoo3:2888:3888</span>
       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
       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>
 <p>Here are the minimum configuration keywords that must be defined
         in the configuration file:</p>
@@ -845,7 +864,7 @@ server.3=zoo3:2888:3888</span>
 </dd>
         
 </dl>
-<a name="N10259"></a><a name="sc_advancedConfiguration"></a>
+<a name="N1026A"></a><a name="sc_advancedConfiguration"></a>
 <h4>Advanced Configuration</h4>
 <p>The configuration settings in the section are optional. You can
         use them to further fine tune the behaviour of your ZooKeeper servers.
@@ -936,7 +955,7 @@ server.3=zoo3:2888:3888</span>
 </dd>
         
 </dl>
-<a name="N102B9"></a><a name="sc_clusterOptions"></a>
+<a name="N102CA"></a><a name="sc_clusterOptions"></a>
 <h4>Cluster Options</h4>
 <p>The options in this section are designed for use with an ensemble
         of servers -- that is, when deploying clusters of servers.</p>
@@ -1026,7 +1045,7 @@ server.3=zoo3:2888:3888</span>
         
 </dl>
 <p></p>
-<a name="N10316"></a><a name="Unsafe+Options"></a>
+<a name="N10327"></a><a name="Unsafe+Options"></a>
 <h4>Unsafe Options</h4>
 <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
@@ -1071,7 +1090,7 @@ server.3=zoo3:2888:3888</span>
 </dd>
         
 </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>
 <p>ZooKeeper responds to a small set of commands. Each command is
       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
 imok
 </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>
 <p>ZooKeeper stores its data in a data directory and its transaction
       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.
       Throughput increases and latency decreases when transaction logs reside
       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>
 <p>This directory has two files in it:</p>
 <ul>
@@ -1198,14 +1217,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="N103D4"></a><a name="The+Log+Directory"></a>
+<a name="N103E5"></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="N103DE"></a><a name="File+Management"></a>
+<a name="N103EF"></a><a name="File+Management"></a>
 <h4>File Management</h4>
 <p>The format of snapshot and log files does not change between
         standalone ZooKeeper servers and different configurations of
@@ -1222,7 +1241,7 @@ imok
         needs the latest complete fuzzy snapshot and the log files from the
         start of that snapshot. The PurgeTxnLog utility implements a simple
         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>
 <p>Here are some common problems you can avoid by configuring
       ZooKeeper correctly:</p>
@@ -1276,7 +1295,7 @@ imok
 </dd>
       
 </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>
 <p>For best results, take note of the following list of good
       Zookeeper practices. <em>[tbd...]</em>

文件差异内容过多而无法显示
+ 3 - 3
docs/zookeeperAdmin.pdf


+ 3 - 0
docs/zookeeperInternals.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.4', 'skin/')" id="menu_selected_1.4Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Contributor</div>
 <div id="menu_selected_1.4" class="selectedmenuitemgroup" style="display: block;">

+ 456 - 0
docs/zookeeperJMX.html

@@ -0,0 +1,456 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.8">
+<meta name="Forrest-skin-name" content="pelt">
+<title>ZooKeeper JMX</title>
+<link type="text/css" href="skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
+<link type="text/css" href="skin/profile.css" rel="stylesheet">
+<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="images/favicon.ico">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://hadoop.apache.org/">Hadoop</a> &gt; <a href="http://hadoop.apache.org/zookeeper/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+    |header
+    +-->
+<div class="header">
+<!--+
+    |start group logo
+    +-->
+<div class="grouplogo">
+<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
+</div>
+<!--+
+    |end group logo
+    +-->
+<!--+
+    |start Project Logo
+    +-->
+<div class="projectlogo">
+<a href="http://hadoop.apache.org/zookeeper/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="The Hadoop database"></a>
+</div>
+<!--+
+    |end Project Logo
+    +-->
+<!--+
+    |start Search
+    +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="hadoop.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
+                    <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+    |end search
+    +-->
+<!--+
+    |start Tabs
+    +-->
+<ul id="tabs">
+<li>
+<a class="unselected" href="http://hadoop.apache.org/zookeeper/">Project</a>
+</li>
+<li>
+<a class="unselected" href="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
+</li>
+<li class="current">
+<a class="selected" href="index.html">ZooKeeper 3.1 Documentation</a>
+</li>
+</ul>
+<!--+
+    |end Tabs
+    +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+    |start Subtabs
+    +-->
+<div id="level2tabs"></div>
+<!--+
+    |end Endtabs
+    +-->
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+
+             &nbsp;
+           </div>
+<!--+
+    |start Menu, mainarea
+    +-->
+<!--+
+    |start Menu
+    +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
+<div id="menu_1.1" class="menuitemgroup">
+<div class="menuitem">
+<a href="index.html">Welcome</a>
+</div>
+<div class="menuitem">
+<a href="zookeeperOver.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="zookeeperStarted.html">Getting Started</a>
+</div>
+<div class="menuitem">
+<a href="releasenotes.html">Release Notes</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
+<div id="menu_1.2" class="menuitemgroup">
+<div class="menuitem">
+<a href="api/index.html">API Docs</a>
+</div>
+<div class="menuitem">
+<a href="zookeeperProgrammers.html">Programmer's Guide</a>
+</div>
+<div class="menuitem">
+<a href="javaExample.html">Java Example</a>
+</div>
+<div class="menuitem">
+<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
+</div>
+<div class="menuitem">
+<a href="recipes.html">Recipes</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Admin &amp; Ops</div>
+<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a href="zookeeperAdmin.html">Administrator's Guide</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">JMX</div>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
+<div id="menu_1.4" class="menuitemgroup">
+<div class="menuitem">
+<a href="zookeeperInternals.html">ZooKeeper Internals</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
+<div id="menu_1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
+</div>
+<div class="menuitem">
+<a href="http://wiki.apache.org/hadoop/ZooKeeper/FAQ">FAQ</a>
+</div>
+<div class="menuitem">
+<a href="http://hadoop.apache.org/zookeeper/mailing_lists.html">Mailing Lists</a>
+</div>
+</div>
+<div id="credit"></div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+  |alternative credits
+  +-->
+<div id="credit2"></div>
+</div>
+<!--+
+    |end Menu
+    +-->
+<!--+
+    |start content
+    +-->
+<div id="content">
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="zookeeperJMX.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
+        PDF</a>
+</div>
+<h1>ZooKeeper JMX</h1>
+<div id="minitoc-area">
+<ul class="minitoc">
+<li>
+<a href="#ch_jmx">JMX</a>
+</li>
+<li>
+<a href="#ch_starting">Starting ZooKeeper with JMX enabled</a>
+</li>
+<li>
+<a href="#ch_console">Run a JMX console</a>
+</li>
+<li>
+<a href="#ch_reference">ZooKeeper MBean Reference</a>
+</li>
+</ul>
+</div>
+  
+
+  
+
+  
+<a name="N10009"></a><a name="ch_jmx"></a>
+<h2 class="h3">JMX</h2>
+<div class="section">
+<p>Apache ZooKeeper has extensive support for JMX, allowing you
+    to view and manage a ZooKeeper serving ensemble.</p>
+<p>This document assumes that you have basic knowledge of
+    JMX. See <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">
+    Sun JMX Technology</a> page to get started with JMX.
+    </p>
+<p>See the <a href="http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html">
+    JMX Management Guide</a> for details on setting up local and
+    remote management of VM instances. By default the included
+    <em>zkServer.sh</em> supports only local management -
+    review the linked document to enable support for remote management
+    (beyond the scope of this document).
+    </p>
+</div>
+
+  
+<a name="N10024"></a><a name="ch_starting"></a>
+<h2 class="h3">Starting ZooKeeper with JMX enabled</h2>
+<div class="section">
+<p>The class
+      <em>org.apache.zookeeper.server.quorum.QuorumPeerMain</em>
+      will start a JMX manageable ZooKeeper server. This class
+      registers the proper MBeans during initalization to support JMX
+      monitoring and management of the
+      instance. See <em>bin/zkServer.sh</em> for one
+      example of starting ZooKeeper using QuorumPeerMain.</p>
+</div>
+
+  
+<a name="N10034"></a><a name="ch_console"></a>
+<h2 class="h3">Run a JMX console</h2>
+<div class="section">
+<p>There are a number of JMX consoles available which can connect
+      to the running server. For this example we will use Sun's
+      <em>jconsole</em>.</p>
+<p>The Java JDK ships with a simple JMX console
+      named <a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html">jconsole</a>
+      which can be used to connect to ZooKeeper and inspect a running
+      server. Once you've started ZooKeeper using QuorumPeerMain
+      start <em>jconsole</em>, which typically resides in
+      <em>JDK_HOME/bin/jconsole</em>
+</p>
+<p>When the "new connection" window is displayed either connect
+      to local process (if jconsole started on same host as Server) or
+      use the remote process connection.</p>
+<p>By default the "overview" tab for the VM is displayed (this
+      is a great way to get insight into the VM btw). Select
+      the "MBeans" tab.</p>
+<p>You should now see <em>org.apache.ZooKeeperService</em>
+      on the left hand side. Expand this item and depending on how you've
+      started the server you will be able to monitor and manage various
+      service related features.</p>
+<p>Also note that ZooKeeper will register log4j MBeans as
+    well. In the same section along the left hand side you will see
+    "log4j". Expand that to manage log4j through JMX. Of particular
+    interest is the ability to dynamically change the logging levels
+    used by editing the appender and root thresholds. Log4j MBean
+    registration can be disabled by passing
+    <em>-Dzookeeper.jmx.log4j.disable=true</em> to the JVM
+    when starting ZooKeeper.
+    </p>
+</div>
+
+  
+<a name="N1005F"></a><a name="ch_reference"></a>
+<h2 class="h3">ZooKeeper MBean Reference</h2>
+<div class="section">
+<p>This table details JMX for a server participating in a
+    replicated ZooKeeper ensemble (ie not standalone). This is the
+    typical case for a production environment.</p>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+<caption>MBeans, their names and description</caption>
+      
+<title>MBeans, their names and description</title>
+
+      
+          
+<tr>
+            
+<th>MBean</th>
+            <th>MBean Object Name</th>
+            <th>Description</th>
+          
+</tr>
+        
+          
+<tr>
+            
+<td>Quorum</td>
+            <td>ReplicatedServer_id&lt;#&gt;</td>
+            <td>Represents the Quorum, or Ensemble - parent of all
+            cluster members. Note that the object name includes the
+            "myid" of the server (name suffix) that your JMX agent has
+            connected to.</td>
+          
+</tr>
+          
+<tr>
+            
+<td>LocalPeer|RemotePeer</td>
+            <td>replica.&lt;#&gt;</td>
+            <td>Represents a local or remote peer (ie server
+            participating in the ensemble). Note that the object name
+            includes the "myid" of the server (name suffix).</td>
+          
+</tr>
+          
+<tr>
+            
+<td>LeaderElection</td>
+            <td>LeaderElection</td>
+            <td>Represents a ZooKeeper cluster leader election which is
+            in progress. Provides information about the election, such as
+            when it started.</td>
+          
+</tr>
+          
+<tr>
+            
+<td>Leader</td>
+            <td>Leader</td>
+            <td>Indicates that the parent replica is the leader and
+            provides attributes/operations for that server. Note that
+            Leader is a subclass of ZooKeeperServer, so it provides
+            all of the information normally associated with a
+            ZooKeeperServer node.</td>
+          
+</tr>
+          
+<tr>
+            
+<td>Follower</td>
+            <td>Follower</td>
+            <td>Indicates that the parent replica is a follower and
+            provides attributes/operations for that server. Note that
+            Follower is a subclass of ZooKeeperServer, so it provides
+            all of the information normally associated with a
+            ZooKeeperServer node.</td>
+          
+</tr>
+          
+<tr>
+            
+<td>DataTree</td>
+            <td>InMemoryDataTree</td>
+            <td>Statistics on the in memory znode database, also
+            operations to access finer (and more computationally
+            intensive) statistics on the data (such as ephemeral
+            count). InMemoryDataTrees are children of ZooKeeperServer
+            nodes.</td>
+          
+</tr>
+          
+<tr>
+            
+<td>ServerCnxn</td>
+            <td>&lt;session_id&gt;</td>
+            <td>Statistics on each client connection, also
+            operations on those connections (such as
+            termination). Note the object name is the session id of
+            the connection in hex form.</td>
+          
+</tr>
+    
+</table>
+<p>This table details JMX for a standalone server. Typically
+    standalone is only used in development situations.</p>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+<caption>MBeans, their names and description</caption>
+      
+<title>MBeans, their names and description</title>
+
+      
+          
+<tr>
+            
+<th>MBean</th>
+            <th>MBean Object Name</th>
+            <th>Description</th>
+          
+</tr>
+        
+          
+<tr>
+            
+<td>ZooKeeperServer</td>
+            <td>StandaloneServer_port&lt;#&gt;</td>
+            <td>Statistics on the running server, also operations
+            to reset these attributes. Note that the object name
+            includes the client port of the server (name
+            suffix).</td>
+          
+</tr>
+          
+<tr>
+            
+<td>DataTree</td>
+            <td>InMemoryDataTree</td>
+            <td>Statistics on the in memory znode database, also
+            operations to access finer (and more computationally
+            intensive) statistics on the data (such as ephemeral
+            count).</td>
+          
+</tr>
+          
+<tr>
+            
+<td>ServerCnxn</td>
+            <td>&lt;session_id&gt;</td>
+            <td>Statistics on each client connection, also
+            operations on those connections (such as
+            termination). Note the object name is the session id of
+            the connection in hex form.</td>
+          
+</tr>
+    
+</table>
+</div>
+
+
+<p align="right">
+<font size="-2"></font>
+</p>
+</div>
+<!--+
+    |end content
+    +-->
+<div class="clearboth">&nbsp;</div>
+</div>
+<div id="footer">
+<!--+
+    |start bottomstrip
+    +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<div class="copyright">
+        Copyright &copy;
+         2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
+</div>
+<!--+
+    |end bottomstrip
+    +-->
+</div>
+</body>
+</html>

文件差异内容过多而无法显示
+ 74 - 0
docs/zookeeperJMX.pdf


+ 3 - 0
docs/zookeeperOver.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">

+ 3 - 0
docs/zookeeperProgrammers.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">

+ 3 - 0
docs/zookeeperStarted.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">

+ 3 - 0
docs/zookeeperTutorial.html

@@ -140,6 +140,9 @@ document.write("Last Published: " + document.lastModified);
 <div class="menuitem">
 <a href="zookeeperAdmin.html">Administrator's Guide</a>
 </div>
+<div class="menuitem">
+<a href="zookeeperJMX.html">JMX</a>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
 <div id="menu_1.4" class="menuitemgroup">

+ 16 - 11
src/docs/src/documentation/content/xdocs/index.xml

@@ -24,17 +24,21 @@
   </header>
   
   <body>
-    <p>
-ZooKeeper is a high-performance coordination service for distributed applications. 
-It exposes common services - such as naming, configuration management, synchronization, 
-and group services - in a simple interface so you don't have to write them from scratch. 
-You can use it off-the-shelf to implement consensus, group management, leader election, 
-and presence protocols. And you can build on it for your own, specific needs.
-</p>
+    <p>ZooKeeper is a high-performance coordination service for
+      distributed applications.  It exposes common services - such as
+      naming, configuration management, synchronization, and group
+      services - in a simple interface so you don't have to write them
+      from scratch.  You can use it off-the-shelf to implement
+      consensus, group management, leader election, and presence
+      protocols. And you can build on it for your own, specific needs.
+    </p>
 
-<p>
-The following documents describe concepts and procedures to get you started using ZooKeeper. If you have more questions, please ask the <a href="ext:lists">mailing list</a> or browse the archives.
-</p>
+    <p>
+      The following documents describe concepts and procedures to get
+      you started using ZooKeeper. If you have more questions, please
+      ask the <a href="ext:lists">mailing list</a> or browse the
+      archives.
+    </p>
     <ul>
 
       <li><strong>ZooKeeper Overview</strong><p>Technical Overview Documents for Client Developers, Adminstrators, and Contributors</p>
@@ -56,7 +60,8 @@ The following documents describe concepts and procedures to get you started usin
       
       <li><strong>Administrators &amp; Operators</strong> <p> Documents for Administrators and Operations Engineers of ZooKeeper Deployments</p>
       <ul>
-      <li><a href="zookeeperAdmin.html">Administrator's Guide</a> - a guide for system administrators and anyone else who might deploy Zookeeer</li>
+      <li><a href="zookeeperAdmin.html">Administrator's Guide</a> - a guide for system administrators and anyone else who might deploy ZooKeeper</li>
+      <li><a href="zookeeperJMX.html">JMX</a> - how to enable JMX in ZooKeeper</li>
       </ul>
       </li>
       

+ 2 - 1
src/docs/src/documentation/content/xdocs/site.xml

@@ -47,7 +47,8 @@ See http://forrest.apache.org/docs/linking.html for more info.
   </docs>
   
   <docs label="Admin &amp; Ops">
-      <admin     label="Administrator's Guide"  href="zookeeperAdmin.html" />
+      <admin label="Administrator's Guide"  href="zookeeperAdmin.html" />
+      <jmx   label="JMX"                    href="zookeeperJMX.html" />
   </docs>
   
   <docs label="Contributor">

+ 18 - 4
src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml

@@ -193,11 +193,25 @@ server.3=zoo3:2888:3888</computeroutput></para>
         </listitem>
 
         <listitem>
-          <para>If your configuration file is set up, you can start
-          ZooKeeper:</para>
+          <para>If your configuration file is set up, you can start a
+          ZooKeeper server:</para>
+
+          <para><computeroutput>$ java -cp zookeeper.jar:lib/log4j-1.2.15.jar:conf \
+              org.apache.zookeeper.server.quorum.QuorumPeerMain zoo.cfg
+          </computeroutput></para>
+          
+          <para>QuorumPeerMain starts a ZooKeeper server,
+            <ulink url="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</ulink>
+            management beans are also registered which allows
+            management through a JMX management console. 
+            The <ulink url="zookeeperJMX.html">ZooKeeper JMX
+            document</ulink> contains details on managing ZooKeeper with JMX.
+          </para>
+
+          <para>See the script <emphasis>bin/zkServer.sh</emphasis>,
+            which is included in the release, for an example
+            of starting server instances.</para>
 
-          <para><computeroutput>$ java -cp zookeeper.jar:src/java/lib/log4j-1.2.15.jar:conf \
-        org.apache.zookeeper.server.quorum.ManagedQuorumPeerMain zoo.cfg</computeroutput></para>
         </listitem>
 
         <listitem>

+ 236 - 0
src/docs/src/documentation/content/xdocs/zookeeperJMX.xml

@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2002-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!DOCTYPE article PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.0//EN"
+"http://www.oasis-open.org/docbook/xml/simple/1.0/sdocbook.dtd">
+<article id="bk_zookeeperjmx">
+  <title>ZooKeeper JMX</title>
+
+  <articleinfo>
+    <legalnotice>
+      <para>Licensed under the Apache License, Version 2.0 (the "License");
+      you may not use this file except in compliance with the License. You may
+      obtain a copy of the License at <ulink
+      url="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</ulink>.</para>
+
+      <para>Unless required by applicable law or agreed to in writing,
+      software distributed under the License is distributed on an "AS IS"
+      BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied. See the License for the specific language governing permissions
+      and limitations under the License.</para>
+    </legalnotice>
+
+    <abstract>
+      <para>ZooKeeper support for JMX</para>
+    </abstract>
+  </articleinfo>
+
+  <section id="ch_jmx">
+    <title>JMX</title>
+    <para>Apache ZooKeeper has extensive support for JMX, allowing you
+    to view and manage a ZooKeeper serving ensemble.</para>
+
+    <para>This document assumes that you have basic knowledge of
+    JMX. See <ulink
+    url="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">
+    Sun JMX Technology</ulink> page to get started with JMX.
+    </para>
+
+    <para>See the <ulink
+    url="http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html">
+    JMX Management Guide</ulink> for details on setting up local and
+    remote management of VM instances. By default the included
+    <emphasis>zkServer.sh</emphasis> supports only local management -
+    review the linked document to enable support for remote management
+    (beyond the scope of this document).
+    </para>
+
+  </section>
+
+  <section id="ch_starting">
+    <title>Starting ZooKeeper with JMX enabled</title>
+
+    <para>The class
+      <emphasis>org.apache.zookeeper.server.quorum.QuorumPeerMain</emphasis>
+      will start a JMX manageable ZooKeeper server. This class
+      registers the proper MBeans during initalization to support JMX
+      monitoring and management of the
+      instance. See <emphasis>bin/zkServer.sh</emphasis> for one
+      example of starting ZooKeeper using QuorumPeerMain.</para>
+  </section>
+
+  <section id="ch_console">
+    <title>Run a JMX console</title>
+
+    <para>There are a number of JMX consoles available which can connect
+      to the running server. For this example we will use Sun's
+      <emphasis>jconsole</emphasis>.</para>
+
+    <para>The Java JDK ships with a simple JMX console
+      named <ulink url="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html">jconsole</ulink>
+      which can be used to connect to ZooKeeper and inspect a running
+      server. Once you've started ZooKeeper using QuorumPeerMain
+      start <emphasis>jconsole</emphasis>, which typically resides in
+      <emphasis>JDK_HOME/bin/jconsole</emphasis></para>
+
+    <para>When the "new connection" window is displayed either connect
+      to local process (if jconsole started on same host as Server) or
+      use the remote process connection.</para>
+
+    <para>By default the "overview" tab for the VM is displayed (this
+      is a great way to get insight into the VM btw). Select
+      the "MBeans" tab.</para>
+
+    <para>You should now see <emphasis>org.apache.ZooKeeperService</emphasis>
+      on the left hand side. Expand this item and depending on how you've
+      started the server you will be able to monitor and manage various
+      service related features.</para>
+
+    <para>Also note that ZooKeeper will register log4j MBeans as
+    well. In the same section along the left hand side you will see
+    "log4j". Expand that to manage log4j through JMX. Of particular
+    interest is the ability to dynamically change the logging levels
+    used by editing the appender and root thresholds. Log4j MBean
+    registration can be disabled by passing
+    <emphasis>-Dzookeeper.jmx.log4j.disable=true</emphasis> to the JVM
+    when starting ZooKeeper.
+    </para>
+
+  </section>
+
+  <section id="ch_reference">
+    <title>ZooKeeper MBean Reference</title>
+
+    <para>This table details JMX for a server participating in a
+    replicated ZooKeeper ensemble (ie not standalone). This is the
+    typical case for a production environment.</para>
+
+    <table>
+      <title>MBeans, their names and description</title>
+
+      <tgroup cols='4'>
+        <thead>
+          <row>
+            <entry>MBean</entry>
+            <entry>MBean Object Name</entry>
+            <entry>Description</entry>
+          </row>
+        </thead>
+        <tbody>
+          <row>
+            <entry>Quorum</entry>
+            <entry>ReplicatedServer_id&lt;#&gt;</entry>
+            <entry>Represents the Quorum, or Ensemble - parent of all
+            cluster members. Note that the object name includes the
+            "myid" of the server (name suffix) that your JMX agent has
+            connected to.</entry>
+          </row>
+          <row>
+            <entry>LocalPeer|RemotePeer</entry>
+            <entry>replica.&lt;#&gt;</entry>
+            <entry>Represents a local or remote peer (ie server
+            participating in the ensemble). Note that the object name
+            includes the "myid" of the server (name suffix).</entry>
+          </row>
+          <row>
+            <entry>LeaderElection</entry>
+            <entry>LeaderElection</entry>
+            <entry>Represents a ZooKeeper cluster leader election which is
+            in progress. Provides information about the election, such as
+            when it started.</entry>
+          </row>
+          <row>
+            <entry>Leader</entry>
+            <entry>Leader</entry>
+            <entry>Indicates that the parent replica is the leader and
+            provides attributes/operations for that server. Note that
+            Leader is a subclass of ZooKeeperServer, so it provides
+            all of the information normally associated with a
+            ZooKeeperServer node.</entry>
+          </row>
+          <row>
+            <entry>Follower</entry>
+            <entry>Follower</entry>
+            <entry>Indicates that the parent replica is a follower and
+            provides attributes/operations for that server. Note that
+            Follower is a subclass of ZooKeeperServer, so it provides
+            all of the information normally associated with a
+            ZooKeeperServer node.</entry>
+          </row>
+          <row>
+            <entry>DataTree</entry>
+            <entry>InMemoryDataTree</entry>
+            <entry>Statistics on the in memory znode database, also
+            operations to access finer (and more computationally
+            intensive) statistics on the data (such as ephemeral
+            count). InMemoryDataTrees are children of ZooKeeperServer
+            nodes.</entry>
+          </row>
+          <row>
+            <entry>ServerCnxn</entry>
+            <entry>&lt;session_id&gt;</entry>
+            <entry>Statistics on each client connection, also
+            operations on those connections (such as
+            termination). Note the object name is the session id of
+            the connection in hex form.</entry>
+          </row>
+    </tbody></tgroup></table>
+
+    <para>This table details JMX for a standalone server. Typically
+    standalone is only used in development situations.</para>
+
+    <table>
+      <title>MBeans, their names and description</title>
+
+      <tgroup cols='4'>
+        <thead>
+          <row>
+            <entry>MBean</entry>
+            <entry>MBean Object Name</entry>
+            <entry>Description</entry>
+          </row>
+        </thead>
+        <tbody>
+          <row>
+            <entry>ZooKeeperServer</entry>
+            <entry>StandaloneServer_port&lt;#&gt;</entry>
+            <entry>Statistics on the running server, also operations
+            to reset these attributes. Note that the object name
+            includes the client port of the server (name
+            suffix).</entry>
+          </row>
+          <row>
+            <entry>DataTree</entry>
+            <entry>InMemoryDataTree</entry>
+            <entry>Statistics on the in memory znode database, also
+            operations to access finer (and more computationally
+            intensive) statistics on the data (such as ephemeral
+            count).</entry>
+          </row>
+          <row>
+            <entry>ServerCnxn</entry>
+            <entry>&lt;session_id&gt;</entry>
+            <entry>Statistics on each client connection, also
+            operations on those connections (such as
+            termination). Note the object name is the session id of
+            the connection in hex form.</entry>
+          </row>
+    </tbody></tgroup></table>
+
+  </section>
+
+</article>

部分文件因为文件数量过多而无法显示