[
https://issues.apache.org/jira/browse/YARN-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsuyoshi OZAWA updated YARN-1305:
---------------------------------
Attachment: YARN-1305.4.patch
Thank you, Bikas. Updated a patch based on your review.
* Updated getRMHAId()/setConfValue() to show invalid value.
* Updated getRMHAIds() to handle a case RM_HA_IDS is empty. Added a test to
testGetRMServiceId for this.
* Updated getRMHAId() to be an error when HA is enabled but RM_HA_IDS is not
set to have multiple values of RM Id's.
Additionally, I noticed that HAUtil cannot handle configs with
spaces/tabs/return values, because HAUtil uses Configuration#get(), not
getTrimmed(). This patch fixes it.
The log messages with this patch are as follows.
A case RM_HA_ID is empty:
{code}
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Invalid configuration!
yarn.resourcemanager.ha.id needs to be set in a HA configuration
{code}
A case RM_HA_ID is invalid:
{code}
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Invalid configuration!
Invalid value of yarn.resourcemanager.ha.id. Current value is .rm1
{code}
A case RM_HA_IDS is empty or invalid:
{code}
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Invalid configuration!
yarn.resourcemanager.ha.rm-ids is invalid. Current value is null
{code}
A case RM_HA_IDS doesn't contain RM_HA_ID:
{code}
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Invalid configuration!
yarn.resourcemanager.ha.rm-ids([rm2, rm3]) need to contain
yarn.resourcemanager.ha.id(rm1) in a HA configuration.
{code}
A case HAUtil.RPC_ADDRESS_CONF_KEYS related configuration is not set:
{code}
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Invalid configuration!
yarn.resourcemanager.address.rm1 needs to be set in a HA configuration.
{code}
> RMHAProtocolService#serviceInit should handle HAUtil's
> IllegalArgumentException
> -------------------------------------------------------------------------------
>
> Key: YARN-1305
> URL: https://issues.apache.org/jira/browse/YARN-1305
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: resourcemanager
> Affects Versions: 2.2.1
> Reporter: Tsuyoshi OZAWA
> Assignee: Tsuyoshi OZAWA
> Labels: ha
> Attachments: YARN-1305.1.patch, YARN-1305.2.patch, YARN-1305.3.patch,
> YARN-1305.4.patch
>
>
> When yarn.resourcemanager.ha.enabled is true, RMHAProtocolService#serviceInit
> calls HAUtil.setAllRpcAddresses. If the configuration values are null, it
> just throws IllegalArgumentException.
> It's messy to analyse which keys are null, so we should handle it and log the
> name of keys which are null.
> A current log dump is as follows:
> {code}
> 2013-10-15 06:24:53,431 INFO
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager: registered
> UNIX signal handlers for [TERM, HUP, INT]
> 2013-10-15 06:24:54,203 INFO org.apache.hadoop.service.AbstractService:
> Service RMHAProtocolService failed in state INITED; cause:
> java.lang.IllegalArgumentException: Property value must not be null
> java.lang.IllegalArgumentException: Property value must not be null
> at
> com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
> at org.apache.hadoop.conf.Configuration.set(Configuration.java:816)
> at org.apache.hadoop.conf.Configuration.set(Configuration.java:798)
> at org.apache.hadoop.yarn.conf.HAUtil.setConfValue(HAUtil.java:100)
> at
> org.apache.hadoop.yarn.conf.HAUtil.setAllRpcAddresses(HAUtil.java:105)
> at
> org.apache.hadoop.yarn.server.resourcemanager.RMHAProtocolService.serviceInit(RMHAProtocolService.java:60)
> at
> org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
> at
> org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:108)
> at
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceInit(ResourceManager.java:187)
> at
> org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
> at
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:940)
> {code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)