您好,登錄后才能下訂單哦!
今日為了釋放空間,kill了zookeeper進程,沒想到kill了后就啟動不起來了
提示已正常啟動
[root@lnx-a-11 bin]# ./zkServer.sh start
JMX enabled by default
Using config: /home/tester/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@lnx-air-9-27 bin]# ps aux |grep zook
但看后臺進程沒有
查看zookeeper.out日志,有如下提示:
2015-12-31 17:32:04,090 [myid:] - ERROR [main:QuorumPeerMain@85] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /home/tester/zookeeper/bin/../conf/zoo.cfg
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:123)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:101)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
Caused by: java.lang.IllegalArgumentException: /tmp/zookeeper/data/myid file is missing
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:350)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:119)
提示很明顯/tmp/zookeeper/data/myid file is missing
到該目錄下發現確實沒有myid這個文件,大家知道/tmp文件夾是一個臨時目錄,里面的文件很可能過一段時間就會被刪除
查看/etc/cron.daily/tmpwatch文件,顯示如下內容
#! /bin/sh
flags=-umc
/usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/.XIM-unix \
-x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix \
-X '/tmp/hsperfdata_*' 10d /tmp
/usr/sbin/tmpwatch "$flags" 30d /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
if [ -d "$d" ]; then
/usr/sbin/tmpwatch "$flags" -f 30d "$d"
fi
done
可以知道/tmp文件中的內容除了設定的文件將會10d清除一次
所以我們不應該把myid放在/tmp下或者要把這個文件從清除文件中排除出去
添加myid文件,修改zoo.cfg中的data目錄后,再次啟動,啟動成功
[root@lnx-a-11 bin]# ps aux |grep zook
root 21869 24.7 0.8 2584892 35100 pts/2 Sl 17:54 0:01 java -Dzookeeper.log.dir=/home/tester/zookeeper/bin/../logs -Dzookeeper.root.logger=INFO,CONSOLE -cp /home/tester/zookeeper/bin/../build/classes:/home/tester/zookeeper/bin/../build/lib/*.jar:/home/tester/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/tester/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/home/tester/zookeeper/bin/../lib/netty-3.7.0.Final.jar:/home/tester/zookeeper/bin/../lib/log4j-1.2.16.jar:/home/tester/zookeeper/bin/../lib/jline-0.9.94.jar:/home/tester/zookeeper/bin/../zookeeper-3.4.6.jar:/home/tester/zookeeper/bin/../src/java/lib/*.jar:/home/tester/zookeeper/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /home/tester/zookeeper/bin/../conf/zoo.cfg
root 21948 0.0 0.0 103252 808 pts/2 D+ 17:55 0:00 grep zook
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。