QuorumPeerMain,ResourceManager都沒有起來 resourcemanager.log如下 發現連接不上zookeeer,從 中得知s103,s104的QuorumPeerMain沒啟動,去s103的~/zookeeper/zookeeper.out查看日誌,發現 //快照日 ...
QuorumPeerMain,ResourceManager都沒有起來
resourcemanager.log如下
2018-09-28 23:17:02,787 FATAL org.apache.hadoop.yarn.server.resourcemanager.ResourceManager: Error starting ResourceManager
org.apache.hadoop.service.ServiceStateException: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
at org.apache.hadoop.service.ServiceStateException.convert(ServiceStateException.java:59)
at org.apache.hadoop.service.AbstractService.init(AbstractService.java:172)
at org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)
at org.apache.hadoop.yarn.server.resourcemanager.AdminService.serviceInit(AdminService.java:142)
at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
at org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)
at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceInit(ResourceManager.java:267)
at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:1185)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
at org.apache.hadoop.ha.ActiveStandbyElector$WatcherWithClientRef.waitForZKConnectionEvent(ActiveStandbyElector.java:1061)
at org.apache.hadoop.ha.ActiveStandbyElector$WatcherWithClientRef.access$400(ActiveStandbyElector.java:1032)
at org.apache.hadoop.ha.ActiveStandbyElector.getNewZooKeeper(ActiveStandbyElector.java:636)
at org.apache.hadoop.ha.ActiveStandbyElector.createConnection(ActiveStandbyElector.java:775)
at org.apache.hadoop.ha.ActiveStandbyElector.<init>(ActiveStandbyElector.java:229)
at org.apache.hadoop.yarn.server.resourcemanager.EmbeddedElectorService.serviceInit(EmbeddedElectorService.java:92)
at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
... 7 more
發現連接不上zookeeer,從xcall.sh jps
中得知s103,s104的QuorumPeerMain沒啟動,去s103的~/zookeeper/zookeeper.out查看日誌,發現
2018-09-29 03:40:56,375 [myid:103] - ERROR [main:QuorumPeer@692] - Unable to load database on disk
java.io.IOException: Found ^@^@^@ in /home/centos/zookeeper/version-2/acceptedEpoch
at org.apache.zookeeper.server.quorum.QuorumPeer.readLongFromFile(QuorumPeer.java:1362)
at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:677)
at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:635)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:170)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:114)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:81)
dataDir=/home/centos/zookeeper
//快照日誌,在conf/zoo.cfg下,事務日誌和快照日誌位於相同目錄
zookeeper.log.dir=.
//log4j日誌:記錄zokeeper的健康狀態,在conf/log4j.properties下
參考zookeeper日誌配置
解決方法:zookeeper無法啟動"Unable to load database on disk"