gpt4 book ai didi

hadoop - spark-submit 如何设置user.name

转载 作者:可可西里 更新时间:2023-11-01 14:23:42 24 4
gpt4 key购买 nike

要设置

mapreduce.job.user.name=myuser

尝试过

spark-submit  --class com.MyClass
--conf mapreduce.job.user.name=myuser \
--conf spark.mapreduce.job.user.name=myuser \
--master yarn \
--deploy-mode cluster \

也试过

--conf user.name

在 Spark UI 环境中显示

user.name yarn

最佳答案

在 Spark 3 中,将 SPARK_USER 设置为系统属性。

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/util/Utils.scala

  /**
* Returns the current user name. This is the currently logged in user, unless that's been
* overridden by the `SPARK_USER` environment variable.
*/
def getCurrentUserName(): String = {
Option(System.getenv("SPARK_USER"))
.getOrElse(UserGroupInformation.getCurrentUser().getShortUserName())
}

关于hadoop - spark-submit 如何设置user.name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42072638/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com