The NMToken is used for authenticating communication with NodeManager
NodeManager
It is issued by ResourceMananger when ApplicationMaster negotiates resource with ResourceManager and validated on NodeManager side.
ResourceMananger
ApplicationMaster
ResourceManager
375376377378379380381382383384385
try { // create container token and NMToken altogether. container.setContainerToken(rmContext.getContainerTokenSecretManager() .createContainerToken(container.getId(), container.getNodeId(), getUser(), container.getResource())); NMToken nmToken = rmContext.getNMTokenSecretManager().createAndGetNMToken(getUser(), getApplicationAttemptId(), container); if (nmToken != null) { nmTokens.add(nmToken); }
377378379380381382383384385386387
192193194195196197198199200201202
public NMToken createAndGetNMToken(String applicationSubmitter, ApplicationAttemptId appAttemptId, Container container) { try { this.readLock.lock(); HashSet<NodeId> nodeSet = this.appAttemptToNodeKeyMap.get(appAttemptId); NMToken nmToken = null; if (nodeSet != null) { if (!nodeSet.contains(container.getNodeId())) { LOG.info("Sending NMToken for nodeId : " + container.getNodeId() + " for container : " + container.getId()); Token token =