linux – 如何在Ubuntu上停止ZooKeeper?

前端之家收集整理的这篇文章主要介绍了linux – 如何在Ubuntu上停止ZooKeeper?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我按照建议 here在ubuntu 14.04上安装了zookeeperd:

不幸的是,这个过程在某种程度上是不可停止的.我甚至试过杀了-9

user@node1:/opt/zookeeper-3.4.6$ps -ef | grep zookeeper
zookeep+  4008     1  8 01:07 ?        00:00:00 /usr/bin/java -cp /etc/zookeeper/conf:/usr/share/java/jline.jar:/usr/share/java/log4j-1.2.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/xmlParserAPIs.jar:/usr/share/java/netty.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-log4j12.jar:/usr/share/java/zookeeper.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dzookeeper.log.dir=/var/log/zookeeper -Dzookeeper.root.logger=INFO,ROLLINGFILE org.apache.zookeeper.server.quorum.QuorumPeerMain /etc/zookeeper/conf/zoo.cfg

显示过程

user      4055  2823  0 01:07 pts/3    00:00:00 grep --color=auto zookeeper

杀死它

user@node1:/opt/zookeeper-3.4.6$sudo kill -9 4008

校验:

user@node1:/opt/zookeeper-3.4.6$ps -ef | grep zookeeper
zookeep+  4075     1 24 01:07 ?        00:00:00 /usr/bin/java -cp /etc/zookeeper/conf:/usr/share/java/jline.jar:/usr/share/java/log4j-1.2.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/xmlParserAPIs.jar:/usr/share/java/netty.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-log4j12.jar:/usr/share/java/zookeeper.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dzookeeper.log.dir=/var/log/zookeeper -Dzookeeper.root.logger=INFO,ROLLINGFILE org.apache.zookeeper.server.quorum.QuorumPeerMain /etc/zookeeper/conf/zoo.cfg

试试剧本

user@node1:/opt/zookeeper-3.4.6$sudo /etc/init.d/zookeeper stop
user@node1:/opt/zookeeper-3.4.6$ps -ef | grep zookeeper
zookeep+  4075     1 29 01:07 ?        00:00:04 /usr/bin/java -cp /etc/zookeeper/conf:/usr/share/java/jline.jar:/usr/share/java/log4j-1.2.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/xmlParserAPIs.jar:/usr/share/java/netty.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-log4j12.jar:/usr/share/java/zookeeper.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dzookeeper.log.dir=/var/log/zookeeper -Dzookeeper.root.logger=INFO,ROLLINGFILE org.apache.zookeeper.server.quorum.QuorumPeerMain /etc/zookeeper/conf/zoo.cfg

无济于事.

我怎么能阻止动物园管理员

解决方法

你可以尝试:

sudo服务zookeeper停止

停止这个过程.如果它不起作用,你可以检查this link

Stop ZooKeeper. On the ZooKeeper host machine,execute the following command:

su - zookeeper -c "export ZOOCFGDIR=/etc/zookeeper/conf ; export ZOOCFG=zoo.cfg ;source /etc/zookeeper/conf/zookeeper-env.sh ; /usr/lib/zookeeper/bin/zkServer.sh stop"

如果上面的命令没有停止Zookeeper并且kill -9也无法停止,则可能存在僵尸进程.如果是这种情况,您可以查看this Q&A如何停止此类流程.

猜你在找的Linux相关文章