扩展问题之一:
Hadoop: Connecting to ResourceManager failed

Hadoop 2.6.1

我确实配置了ResourceManager HA。

当我杀死“本地” ResourceManager(以检查集群)时,就会发生故障转移,并且其他服务器上的ResourceManager变为 Activity 状态。不幸的是,当我尝试使用“本地”实例nodemanager运行作业时,它不会将请求“故障转移”到 Activity ResourceManager。

yarn@stg-hadoop106:~$ jps
26738 Jps
23463 DataNode
23943 DFSZKFailoverController
24297 NodeManager
25690 ResourceManager
23710 JournalNode
23310 NameNode

#kill and start ResourceManager, so the failover occur
yarn@stg-hadoop106:~$ kill -9 25690
~/hadoop/sbin/yarn-daemon.sh  start resourcemanager

yarn@stg-hadoop106:~$ ~/hadoop/bin/yarn  rmadmin -getServiceState rm1
standby
yarn@stg-hadoop106:~$ ~/hadoop/bin/yarn  rmadmin -getServiceState rm2
active

#run my class:

14:56:51.476 [main] INFO  o.apache.samza.job.yarn.ClientHelper - trying to connect to RM 0.0.0.0:8032
2015-10-29 14:56:51 RMProxy [INFO] Connecting to ResourceManager at /0.0.0.0:8032
14:56:51.572 [main] DEBUG o.a.h.s.a.util.KerberosName - Kerberos krb5 configuration not found, setting default realm to empty
2015-10-29 14:56:51 NativeCodeLoader [WARN] Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
14:56:51.575 [main] DEBUG o.a.hadoop.util.PerformanceAdvisory - Falling back to shell based
2015-10-29 14:56:52 Client [INFO] Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
2015-10-29 14:56:53 Client [INFO] Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)

yarn-site.xml
 <property>
     <name>yarn.resourcemanager.ha.enabled</name>
     <value>true</value>
 </property>
 <property>
     <name>yarn.resourcemanager.cluster-id</name>
     <value>clusterstaging</value>
 </property>
 <property>
     <name>yarn.resourcemanager.ha.rm-ids</name>
     <value>rm1,rm2,rm3</value>
 </property>
 <property>
     <name>yarn.resourcemanager.hostname.rm1</name>
     <value>stg-hadoop106</value>
 </property>
 <property>
     <name>yarn.resourcemanager.hostname.rm2</name>
     <value>stg-hadoop107</value>
 </property>
 <property>
     <name>yarn.resourcemanager.hostname.rm3</name>
     <value>stg-hadoop108</value>
 </property>
 <property>
     <name>yarn.resourcemanager.zk-address</name>
     <value>A:2181,B:2181,C:2181</value>
 </property>

我没有配置
<name>yarn.resourcemanager.hostname</name>

因为它应该按原样工作-如果我错了,请纠正我:)

我确实尝试过
<name>yarn.client.failover-proxy-provider</name>

但没有成功

有任何想法吗?
也许我错误地期望客户端找出 Activity 的RM节点?

您是否知道如何在“自动故障转移”选项中切换节点的 Activity /备用状态?
~/hadoop/bin/yarn  rmadmin -failover rm1 rm2
    Exception in thread "main" java.lang.UnsupportedOperationException: RMHAServiceTarget doesn't have a corresponding ZKFC address

~/hadoop/bin/yarn  rmadmin -transitionToActive rm1 rm2
    Automatic failover is enabled for org.apache.hadoop.yarn.client.RMHAServiceTarget@2b72cb8a
    Refusing to manually manage HA state, since it may cause

最佳答案

如果在自动故障转移模式下启用HA-RM,则无法将 Activity 触发为备用或反向。并且您应该提供yarn.client.failover-proxy-provider参数,该参数是客户端用于故障转移到Active RM的类。并配置yarn.resourcemanager.hostname来标识RM(即rm1,rm2)。

如果未启用自动故障转移,则可以使用以下命令触发yarn rmadmin -transitionToStandby rm1
请进行以上更改并给出结果答复

10-05 17:52