问题
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