hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bikas Saha (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-1412) Allocating Containers on a particular Node in Yarn
Date Fri, 15 Nov 2013 05:59:24 GMT

    [ https://issues.apache.org/jira/browse/YARN-1412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13823323#comment-13823323
] 

Bikas Saha commented on YARN-1412:
----------------------------------

Can you please report if the same is observed when no rack is set. ie. only specific node
is requested without any fallback.
Can you please attach RM logs along with container id of the container returned by the RM
that did not match expectations. Were 

> 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
>
> I am trying to allocate containers on a particular node in Yarn but Yarn is returning
me containers on different node although the requested node has resources available.
> 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),false));
>     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)

Mime
View raw message