Skip to content

Commit 611923a

Browse files
Make sure the namenodes are listed correctly for creating tokens.
1 parent 09fe224 commit 611923a

File tree

1 file changed

+3
-2
lines changed
  • yarn/src/main/scala/org/apache/spark/deploy/yarn

1 file changed

+3
-2
lines changed

yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,9 @@ private[spark] class Client(
411411
// those will fail with an access control issue. So create new tokens with the logged in
412412
// user as renewer.
413413
val creds = new Credentials()
414-
YarnSparkHadoopUtil.get.obtainTokensForNamenodes(Set(stagingDirPath), hadoopConf, creds,
415-
Some(sparkConf.get("spark.yarn.principal")))
414+
val nns = YarnSparkHadoopUtil.get.getNameNodesToAccess(sparkConf) + stagingDirPath
415+
YarnSparkHadoopUtil.get.obtainTokensForNamenodes(
416+
nns, hadoopConf, creds, Some(sparkConf.get("spark.yarn.principal")))
416417
val t = creds.getAllTokens
417418
.filter(_.getKind == DelegationTokenIdentifier.HDFS_DELEGATION_KIND)
418419
.head

0 commit comments

Comments
 (0)