فهرست منبع

ZOOKEEPER-346. remove the kill command fro mthe client port. (phunt via mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@766151 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 16 سال پیش
والد
کامیت
4a5a967354

+ 2 - 0
CHANGES.txt

@@ -58,6 +58,8 @@ BUGFIXES:
   ZOOKEEPER-367. RecoveryTest failure - "unreasonable length" IOException
   (mahadev via phunt)
 
+  ZOOKEEPER-346. remove the kill command fro mthe client port. (phunt via mahadev)
+
 IMPROVEMENTS:
   ZOOKEEPER-308. improve the atomic broadcast performance 3x.
   (breed via mahadev)

+ 14 - 3
bin/zkServer.sh

@@ -53,17 +53,28 @@ ZOOBINDIR=`dirname "$ZOOBIN"`
 
 . $ZOOBINDIR/zkEnv.sh
 
+ZOOPIDFILE=$(grep dataDir $ZOOCFG | sed -e 's/.*=//')/zookeeper_server.pid
+
+
 case $1 in
 start) 
-    echo -n "Starting zookeeper ... "
+    echo  "Starting zookeeper ... "
     java  "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
     -cp $CLASSPATH $JVMFLAGS $ZOOMAIN $ZOOCFG &
+    echo $! > $ZOOPIDFILE
     echo STARTED
     ;;
 stop) 
-    echo -n "Stopping zookeeper ... "
-    echo kill | nc localhost $(grep clientPort $ZOOCFG | sed -e 's/.*=//')
+    echo "Stopping zookeeper ... "
+    if [ ! -f $ZOOPIDFILE ]
+    then
+    echo "error: count not find file $ZOOPIDFILE"
+    exit 1
+    else 
+    kill -9 $(cat $ZOOPIDFILE)
+    rm $ZOOPIDFILE
     echo STOPPED
+    fi
     ;;
 upgrade)
     shift

+ 5 - 1
build.xml

@@ -656,7 +656,11 @@
 	<!-- yet to implement -->
     </target>
     
-    <target name="test-core" depends="test-init, test-category, junit.run, call-test-cppunit"/> 
+    <target name="test-core-java" depends="test-init, test-category, junit.run"/> 
+
+    <target name="test-core-cppunit" depends="test-init, test-category, call-test-cppunit"/> 
+
+    <target name="test-core" depends="test-core-java, test-core-cppunit"/> 
 
     <!-- ====================================================== -->
     <!-- Run optional third-party tool targets                  -->

+ 0 - 9
src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml

@@ -859,15 +859,6 @@ server.3=zoo3:2888:3888</computeroutput></para>
           </listitem>
         </varlistentry>
 
-        <varlistentry>
-          <term>kill</term>
-
-          <listitem>
-            <para>Shuts down the server. This must be issued from the machine
-            the ZooKeeper server is running on.</para>
-          </listitem>
-        </varlistentry>
-
         <varlistentry>
           <term>reqs</term>
 

+ 0 - 4
src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java

@@ -564,10 +564,6 @@ public class NIOServerCnxn implements Watcher, ServerCnxn {
                 sendBuffer(NIOServerCnxn.closeConn);
                 k.interestOps(SelectionKey.OP_WRITE);
                 return;
-            } else if (len == killCmd) {
-                LOG.info("Processing kill command from "
-                        + sock.socket().getRemoteSocketAddress());
-                System.exit(0);
             } else if (len == getTraceMaskCmd) {
                 LOG.info("Processing getracemask command from "
                         + sock.socket().getRemoteSocketAddress());

+ 0 - 2
src/java/main/org/apache/zookeeper/server/ServerCnxn.java

@@ -35,8 +35,6 @@ public interface ServerCnxn extends Watcher {
      * See <a href="{@docRoot}/../../../docs/zookeeperAdmin.html#sc_zkCommands">
      * Zk Admin</a>. this link is for all the commands.
      */
-    final static int killCmd = ByteBuffer.wrap("kill".getBytes()).getInt();
-    
     final static int ruokCmd = ByteBuffer.wrap("ruok".getBytes()).getInt();
 
     final static int dumpCmd = ByteBuffer.wrap("dump".getBytes()).getInt();