启用Kerberos后,Yarn中ResourceManager启动失败:KeeperErrorCode = BadVersion for /yarn-leader-election

日志报错:

2018-08-09 11:36:21,783 INFO  service.AbstractService (AbstractService.java:noteFailure(272)) - Service org.apache.hadoop.yarn.server.resourcemanager.EmbeddedElectorService failed in state INITED; cause: java.io.IOException: Couldn't set ACLs on parent ZNode: /yarn-leader-election
java.io.IOException: Couldn't set ACLs on parent ZNode: /yarn-leader-election
    at org.apache.hadoop.ha.ActiveStandbyElector.ensureParentZNode(ActiveStandbyElector.java:351)
    at org.apache.hadoop.yarn.server.resourcemanager.EmbeddedElectorService.serviceInit(EmbeddedElectorService.java:103)
    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.AdminService.serviceInit(AdminService.java:152)
    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:281)
    at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
    at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:1236)
Caused by: org.apache.zookeeper.KeeperException$BadVersionException: KeeperErrorCode = BadVersion for /yarn-leader-election
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:115)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.setACL(ZooKeeper.java:1399)
    at org.apache.hadoop.ha.ActiveStandbyElector$7.run(ActiveStandbyElector.java:1050)
    at org.apache.hadoop.ha.ActiveStandbyElector$7.run(ActiveStandbyElector.java:1044)
    at org.apache.hadoop.ha.ActiveStandbyElector.zkDoWithRetries(ActiveStandbyElector.java:1067)
    at org.apache.hadoop.ha.ActiveStandbyElector.setAclsWithRetries(ActiveStandbyElector.java:1044)
    at org.apache.hadoop.ha.ActiveStandbyElector.ensureParentZNode(ActiveStandbyElector.java:349)

解决办法:在zookeeper中删除/yarn-election,步骤如下 :
su zookeeper
klist
kinit -kt /etc/security/keytabs/zk.service.keytab zookeeper/139.bd
cd /usr/hdp/current/zookeeper-client/bin/
./zookeeper-client -server MASTER-HOST
ls /
rmr /yarn-leader-election
重启Yarn

你可能感兴趣的:(YARN,Kerberos)