Quantcast
Channel: Hortonworks » All Replies
Viewing all articles
Browse latest Browse all 3435

Reply To: Set user for YARN containers

$
0
0

Did you figured out how to run a command under a user. Have the same issue. Have a next code:


private def setupTokens(username: String): ByteBuffer = {
    val credentials = UserGroupInformation.createProxyUser(username, UserGroupInformation.getCurrentUser).getCredentials
    val dob = new DataOutputBuffer();
    credentials.writeTokenStorageToStream(dob);
    ByteBuffer.wrap(dob.getData(), 0, dob.getLength()).duplicate();
  }
val cCLC = Records.newRecord(classOf[ContainerLaunchContext])
cCLC.setTokens(setupTokens(user))

But it still running under yarn user.


Viewing all articles
Browse latest Browse all 3435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>