[ https://issues.apache.org/jira/browse/YARN-1660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13891551#comment-13891551 ]
Karthik Kambatla commented on YARN-1660: ---------------------------------------- Just skimmed through the patch. Few comments: # We should may be move getRMDefaultPortNumber to YarnConfiguration # Didn't quite understand why we need the following change: {code} static String getConfKeyForRMInstance(String prefix, Configuration conf) { - return YarnConfiguration.RM_SERVICES_ADDRESS_CONF_KEYS.contains(prefix) - ? addSuffix(prefix, getRMHAId(conf)) - : prefix; + if (! YarnConfiguration.RM_SERVICES_ADDRESS_CONF_KEYS.contains(prefix)) { + return prefix; + } else { + String RMId = getRMHAId(conf); + checkAndSetRMRPCAddress(prefix, RMId, conf); + return addSuffix(prefix, RMId); + } {code} # I would use two different variables for the confKey corresponding to the RPC-address conf, and the confKey for hostname. {code} + private static void checkAndSetRMRPCAddress(String prefix, String RMId, + Configuration conf) { + String confKey = null; + try { + confKey = addSuffix(prefix, RMId); + if (conf.getTrimmed(confKey) == null) { + confKey = addSuffix(YarnConfiguration.RM_HOSTNAME, RMId); + String confVal = conf.getTrimmed(confKey); + if (confVal == null) { + throwBadConfigurationException(getNeedToSetValueMessage(confKey + + " or " + addSuffix(prefix, RMId))); + } else { + conf.set(addSuffix(prefix, RMId), confVal + ":" + + getRMDefaultPortNumber(prefix)); + } + } {code} > add the ability to set yarn.resourcemanager.hostname.rm-id instead of setting > all the various host:port properties for RM > ------------------------------------------------------------------------------------------------------------------------- > > Key: YARN-1660 > URL: https://issues.apache.org/jira/browse/YARN-1660 > Project: Hadoop YARN > Issue Type: Sub-task > Components: resourcemanager > Reporter: Arpit Gupta > Assignee: Xuan Gong > Attachments: YARN-1660.1.patch > > > Currently the user has to specify all the various host:port properties for > RM. We should follow the pattern that we do for non HA setup where we can > specify yarn.resourcemanager.hostname.rm-id and the defaults are used for all > other affected properties. -- This message was sent by Atlassian JIRA (v6.1.5#6160)