欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-04-28 10:05:27
...

1、问题

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

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

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、解决方法:

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

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

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

 

 

 

 

相关标签: yarn