hadoop resourcemanager ha连接到resourcemanager at/0.0.0.0:8032

5cg8jx4n  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(874)

扩展问题之一:hadoop:连接到resourcemanager失败
hadoop 2.6.1版
我确实配置了resourcemanager ha。
当我杀死'local'resourcemanager(检查集群)时,就会发生故障转移,并且其他服务器上的resourcemanager变为活动状态。不幸的是,当我尝试使用“本地”示例nodemanager运行作业时,它不会将请求“故障转移”到活动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>

但没有成功
有什么想法吗?也许我错误地期望客户机发现活动的rm节点?
您知道如何在“自动故障切换”选项中切换节点的活动/备用吗?

~/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
a7qyws3x

a7qyws3x1#

如果在自动故障转移模式下启用ha-rm,则不能将active触发为备用或相反。你应该提供 yarn.client.failover-proxy-provider 参数,客户端用于故障转移到活动rm的类。以及配置 yarn.resourcemanager.hostname 识别rm(即rm1、rm2)。
如果未启用自动故障转移,则可以使用以下命令触发 yarn rmadmin -transitionToStandby rm1 请做以上更改并给出结果答复

相关问题