蔬菜小程序的开发全流程详解
841
2022-09-21
zookeeper无法启动解决
今日为了释放空间,kill了zookeeper进程,没想到kill了后就启动不起来了
提示已正常启动
[root@lnx-a-11 bin]# ./zkServer.sh startJMX enabled by defaultUsing config: /home/tester/zookeeper/bin/../conf/zoo.cfgStarting 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 abnormallyorg.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/shflags=-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/tmpfor d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do if [ -d "$d" ]; then /usr/sbin/tmpwatch "$flags" -f 30d "$d" fidone
可以知道/tmp文件中的内容除了设定的文件将会10d清除一次
所以我们不应该把myid放在/tmp下或者要把这个文件从清除文件中排除出去
添加myid文件,修改zoo.cfg中的data目录后,再次启动,启动成功
[root@lnx-a-11 bin]# ps aux |grep zookroot 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.cfgroot 21948 0.0 0.0 103252 808 pts/2 D+ 17:55 0:00 grep zook
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~