[myid:] - ERROR [main:QuorumPeerMain@88] - Invalid config, exiting abnormally:/myid file is missing
在启动zookeeper集群时发现没启动成功,查看日志发现如下报错:2019-08-31 09:18:14,407 [myid:] - ERROR [main:QuorumPeerMain@88] - Invalid config, exiting abnormallyorg.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigExcep..
·
在启动zookeeper集群时发现没启动成功,查看日志(若未配置日志存放目录则在启动命令目录下打开zookeeper.out文件)发现如下报错:
2019-08-31 09:18:14,407 [myid:] - ERROR [main:QuorumPeerMain@88] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /usr/SFT/zookeeper-3.4.12/bin/../conf/zoo.cfg
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:156)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:104)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:81)
Caused by: java.lang.IllegalArgumentException: /usr/SFT/zookeeper-3.4.12/zkData/myid file is missing
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:408)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:152)
... 2 more
Invalid config, exiting abnormally
提示缺少myid。
打开ZOOKEEPER_HOME/$dataDir目录发现缺少myid文件,之前一不小心把 $dataDir目录删了。。。
在此目录下创建文件并输入id:
echo 1 > myid
注意
1、输入的内容num要与配置文件的server.A中的A字段相匹配,每个节点的myid要唯一。
2、echo 1 >myid
中的1
与>
有一个空格,若没有空格,这行代码的结果就不一样了。
3、zk集群安装详见zookeeper安装配置笔记
更多推荐
已为社区贡献1条内容
所有评论(0)