Thanks Alejandro for the quick answer. Sujeet, can you please give an overview of what use case you are trying to solve with the unmanaged AM? We initially did the unmanaged AM for local debugging of AM's with the additional scope that users could use it for non-debugging (real deployment) scenarios (like the LAMA AM does). It would be helpful for us to understand future investment scope for the unmanaged AM as more such scenarios show up. So your scenario would help.
Thanks Bikas -----Original Message----- From: Alejandro Abdelnur [mailto:[email protected]] Sent: Monday, January 27, 2014 11:13 AM To: [email protected] Subject: Re: AMRMTokens with Unmanaged Application Master Something along the following lines would do: ----- UserGroupInformation ugi = //get your UGI ... YarnClient yarnClient = YarnClient.createYarnClient(); yarnClient.init(yarnConf); yarnClient.start(); YarnClientApplication app = yarnClient.createApplication(); ApplicationSubmissionContext appCtx =Records.newRecord(ApplicationSubmissionContext.class); appCtx.setApplicationId(appId); appCtx.setUnmanagedAM(true); // other settings to appCtx ApplicationId appId = yarnClient.submitApplication(appContext); // wait until application state is ACCEPTED ugi.addToken(yarnClient.getAMRMToken(appId)); ----- thx On Mon, Jan 27, 2014 at 10:49 AM, Sujeet Varakhedi <[email protected] > wrote: > Hi All, > I am not sure if this is the right alias to ask this question. Let me > know if there is any other for these type of questions. > I am trying to create an Unmanaged ApplicationMaster and having issues > with creating AMRMtokens right. I peeked into the TestAMRMtokens.java > test cases and here is what I have come up with. (This is scala code) > > > *def getNextAttemptid() : ApplicationAttemptId = {* > * val t = java.lang.System.currentTimeMillis()* > * > > ConverterUtils.toApplicationAttemptId(ConverterUtils.APPLICATION_ATTEM > PT_PREFIX > + "_" + t.toString() + "_0001" + "_0001")* > * }* > > * appAttemptId = getNextAttemptid()* > > > * UserGroupInformation.setConfiguration(yarnConf)* > * val ugi = UserGroupInformation.getCurrentUser()* > * val tokenIdentifier = new AMRMTokenIdentifier(appAttemptId)* > * val secretManager = new AMRMTokenSecretManager(yarnConf)* > * val token: Token[_ <: TokenIdentifier] = new > Token[AMRMTokenIdentifier](tokenIdentifier, secretManager)* > * ugi.addToken(token)* > > * amClient = AMRMClient.createAMRMClient()* > * amClient.init(yarnConf)* > * amClient.start()* > * val appMasterResponse = > amClient.registerApplicationMaster("localhost", 0, "") * > > > > > Yarn does not like this request and says: > 2014-01-27 10:47:10,938 WARN SecurityLogger.org.apache.hadoop.ipc.Server: > Auth failed for 127.0.0.1:63085:null (DIGEST-MD5: IO error acquiring > password) > 2014-01-27 10:47:10,938 INFO org.apache.hadoop.ipc.Server: IPC Server > listener on 8030: readAndProcess from client 127.0.0.1 threw exception > [org.apache.hadoop.security.token.SecretManager$InvalidToken: Password > not found for ApplicationAttempt appattempt_1390848430314_0001_000001] > > > I am sure I am doing something wrong. Is a documentation or example > code that tells how to create the tokens right? > > Thanks in advance > > Sujeet > -- Alejandro -- CONFIDENTIALITY NOTICE NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.
