00-zookeeper启动报错: myid file is missing 和 Problem starting AdminServer
2016/05/14 08:00 于 数据分析 0
zookeeper集群节点启动时候会读取“dataDir”目录下的id,所以必须在对应节点的“dataDir”目录下创建“myid”文件,里面填写serverid
举例:
vim conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/data/zookeeper
clientPort=2181
server.1=192.168.1.128:2008:6008
server.2=192.168.1.128:2008:6008
server.3=192.168.1.129:2008:6008
我在这里就需要在
“192.168.1.127”节点echo "1" >/data/zookeeper/myid
“192.168.1.128”节点echo "2" >/data/zookeeper/myid
“192.168.1.129”节点echo "3" >/data/zookeeper/myid
2016-05-14 12:01:01,079 [myid:] - INFO [main:QuorumPeerConfig@114] - Reading configuration from: /usr/local/zookeeper/bin/../conf/zoo.cfg
2016-05-14 12:01:01,085 [myid:] - INFO [main:QuorumPeerConfig@316] - clientPortAddress is 0.0.0.0/0.0.0.0:2181
2016-05-14 12:01:01,085 [myid:] - INFO [main:QuorumPeerConfig@320] - secureClientPort is not set
2016-05-14 12:01:01,089 [myid:] - ERROR [main:QuorumPeerMain@86] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /usr/local/zookeeper/bin/../conf/zoo.cfg
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:135)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:110)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
Caused by: java.lang.IllegalArgumentException: myid file is missing
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.checkValidity(QuorumPeerConfig.java:637)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.setupQuorumPeerConfig(QuorumPeerConfig.java:508)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:348)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:131)
... 2 more
Invalid config, exiting abnormally
zookeeper的管理员端口被占用,需要修改配置里的“zookeeper.admin.serverPort=8080”,默认8080没有写出来,只要改为一个没使用端口即可
2016-05-14 12:17:36,385 [myid:1] - WARN [main:QuorumPeer@723] - Problem starting AdminServer
org.apache.zookeeper.server.admin.AdminServer$AdminServerException: Problem starting AdminServer on address 0.0.0.0, port 8080 and command URL /commands
at org.apache.zookeeper.server.admin.JettyAdminServer.start(JettyAdminServer.java:100)
at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:721)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:183)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:120)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:315)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.Server.doStart(Server.java:235)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.apache.zookeeper.server.admin.JettyAdminServer.start(JettyAdminServer.java:96)
... 4 more
org.apache.zookeeper.server.admin.AdminServer$AdminServerException: Problem starting AdminServer on address 0.0.0.0, port 8080 and command URL /commands
zookeeper
00-zookeeper启动报错: myid file is missing 和 Problem starting AdminServer