Spark-submit how to set the user.name

半世苍凉 提交于 2019-12-23 12:28:20

问题


want to set

mapreduce.job.user.name=myuser

Tried

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

Also tried

--conf user.name

in environment of Spark UI showing

user.name yarn

回答1:


Set as Runtime-Environment Variable

try:

--conf spark.executorEnv.mapreduce.job.user.name=myuser

spark.executorEnv.[EnvironmentVariableName] - Add the environment variable specified by EnvironmentVariableName to the Executor process. The user can specify multiple of these to set multiple environment variables.




回答2:


sudo -su username spark-submit --class com.MyClass

This worked for me.



来源:https://stackoverflow.com/questions/42072638/spark-submit-how-to-set-the-user-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!