[
https://issues.apache.org/jira/browse/YARN-1412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13828412#comment-13828412
]
Bikas Saha commented on YARN-1412:
----------------------------------
I mentioned allocating multiple containers at the same priority as an
experiment to check if the above theory is correct or not.
bq. But since it is not working we are trying to code it.
I am saying that your code (yes, null, true) is the same as the default. The
behavior that you will get (correct or buggy as it is now) will be the same in
both cases.
bq. yarn.scheduler.capacity.node-locality-delay is set to 50 and the size of
cluster is 36.
The max value of this should be the number of nodes in the cluster. Higher than
that has no effect.
Btw, are all nodes in the same rack?
> Allocating Containers on a particular Node in Yarn
> --------------------------------------------------
>
> Key: YARN-1412
> URL: https://issues.apache.org/jira/browse/YARN-1412
> Project: Hadoop YARN
> Issue Type: Bug
> Environment: centos, Hadoop 2.2.0
> Reporter: gaurav gupta
>
> Summary of the problem:
> If I pass the node on which I want container and set relax locality default
> which is true, I don't get back the container on the node specified even if
> the resources are available on the node. It doesn't matter if I set rack or
> not.
> Here is the snippet of the code that I am using
> AMRMClient<ContainerRequest> amRmClient = AMRMClient.createAMRMClient();;
> String host = "h1";
> Resource capability = Records.newRecord(Resource.class);
> capability.setMemory(memory);
> nodes = new String[] {host};
> // in order to request a host, we also have to request the rack
> racks = new String[] {"/default-rack"};
> List<ContainerRequest> containerRequests = new
> ArrayList<ContainerRequest>();
> List<ContainerId> releasedContainers = new ArrayList<ContainerId>();
> containerRequests.add(new ContainerRequest(capability, nodes, racks,
> Priority.newInstance(priority)));
> if (containerRequests.size() > 0) {
> LOG.info("Asking RM for containers: " + containerRequests);
> for (ContainerRequest cr : containerRequests) {
> LOG.info("Requested container: {}", cr.toString());
> amRmClient.addContainerRequest(cr);
> }
> }
> for (ContainerId containerId : releasedContainers) {
> LOG.info("Released container, id={}", containerId.getId());
> amRmClient.releaseAssignedContainer(containerId);
> }
> return amRmClient.allocate(0);
--
This message was sent by Atlassian JIRA
(v6.1#6144)