今日為了釋放空間,kill了zookeeper進(jìn)程,沒想到kill了后就啟動不起來了
創(chuàng)新互聯(lián)是一家集網(wǎng)站建設(shè),西峽企業(yè)網(wǎng)站建設(shè),西峽品牌網(wǎng)站建設(shè),網(wǎng)站定制,西峽網(wǎng)站建設(shè)報(bào)價,網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,西峽網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。提示已正常啟動
[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
但看后臺進(jìn)程沒有
查看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
到該目錄下發(fā)現(xiàn)確實(shí)沒有myid這個文件,大家知道/tmp文件夾是一個臨時目錄,里面的文件很可能過一段時間就會被刪除
查看/etc/cron.daily/tmpwatch文件,顯示如下內(nèi)容
#! /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文件中的內(nèi)容除了設(shè)定的文件將會10d清除一次
所以我們不應(yīng)該把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
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。