hadoop集群启动yarn时出现的问题和解决方法

1、问题

使用start-all.sh 启动hdfs和yarn集群 ,启动后发现resourcemanager没启动,查看日志报错:

hadoop集群启动yarn时出现的问题和解决方法_第1张图片

2020-06-01 09:42:21,280 INFO org.apache.hadoop.service.AbstractService: Service org.apache.hadoop.yarn.server.resourcemanager.AdminService failed in state INITED; cause: org.apache.hadoop.service.ServiceStateException: java.io.IOException: Couldn't create /yarn-leader-election/yrc
org.apache.hadoop.service.ServiceStateException: java.io.IOException: Couldn't create /yarn-leader-election/yrc
	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:1187)
Caused by: java.io.IOException: Couldn't create /yarn-leader-election/yrc
	at org.apache.hadoop.ha.ActiveStandbyElector.ensureParentZNode(ActiveStandbyElector.java:305)
	at org.apache.hadoop.yarn.server.resourcemanager.EmbeddedElectorService.serviceInit(EmbeddedElectorService.java:95)
	at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
	... 7 more
Caused by: org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /yarn-leader-election/yrc
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:127)
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
	at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
	at org.apache.hadoop.ha.ActiveStandbyElector$3.run(ActiveStandbyElector.java:965)
	at org.apache.hadoop.ha.ActiveStandbyElector$3.run(ActiveStandbyElector.java:962)
	at org.apache.hadoop.ha.ActiveStandbyElector.zkDoWithRetries(ActiveStandbyElector.java:1006)
	at org.apache.hadoop.ha.ActiveStandbyElector.createWithRetries(ActiveStandbyElector.java:962)
	at org.apache.hadoop.ha.ActiveStandbyElector.ensureParentZNode(ActiveStandbyElector.java:299)
	... 9 more

查看进程:

hadoop集群启动yarn时出现的问题和解决方法_第2张图片

 

2、解决方法:

进入zookeeper目录:查看有无 /yarn-leader-election目录,如果没有手动创建一下: create  /yarn-leader-election/yrc/

hadoop集群启动yarn时出现的问题和解决方法_第3张图片

然后重启yarn集群 :start-yarn.sh 

 

 

 

 

你可能感兴趣的:(yarn)