In Hadoop2 code, there is a problem with setting up the yarn.resourcemanager.scheduler.address file, for example:
<property> <name>yarn.resourcemanager.scheduler.address</name> <value>qadoop-nn001.apsalar.com:8030</value> </property>
Currently, it is incorrectly placed in the "conf" configuration in Hadoop-2.7.0 / SRC / Hadoop-yarn-project / Hadoop-yarn / Hadoop-yarn common / SRC / Main / Java / org / Apache / Hadoop / thread / client /RMProxy.java
To prove this problem, we fixed this file to directly enter our scheduler address. The patch below is hacking. The main reason is related to the "conf" object, which should load the "yarn.resourcemanager.scheduler.address" property.
@Private protected static <T> T createRMProxy(final Configuration configuration, final Class<T> protocol, RMProxy instance) throws IOException { YarnConfiguration conf = (configuration instanceof YarnConfiguration) ? (YarnConfiguration) configuration : new YarnConfiguration(configuration); LOG.info("LEE: changing the conf to include yarn.resourcemanager.scheduler.address at 10.1.26.1"); conf.set("yarn.resourcemanager.scheduler.address", "10.1.26.1"); RetryPolicy retryPolicy = createRetryPolicy(conf); if (HAUtil.isHAEnabled(conf)) { RMFailoverProxyProvider<T> provider = instance.createRMFailoverProxyProvider(conf, protocol); return (T) RetryProxy.create(protocol, provider, retryPolicy); } else { InetSocketAddress rmAddress = instance.getRMAddress(conf, protocol); LOG.info("LEE: Connecting to ResourceManager at " + rmAddress); T proxy = RMProxy.<T>getProxy(conf, protocol, rmAddress); return (T) RetryProxy.create(protocol, proxy, retryPolicy); } }
EDIT: We solved this problem by adding yarn-site.xml to CLASSPATH. no need to modify RMProxy.java
Lee hounshell
source share