Spark是否支持多个用户?

时间:2018-09-14 08:00:22

标签: apache-spark

目前,我正在运行一个由3个节点组成的Spark 2.3.1集群,并且我还在使用ulab这样的普通用户运行一个齐柏林飞艇服务器。

我从齐柏林飞艇上执行了以下命令:

%spark
val file = sc.textFile("file:///mnt/glusterfs/test/testfile")
file.saveAsTextFile("/mnt/glusterfs/test/testfile2")

它报告许多错误消息,例如:

WARN [2018-09-14 05:44:50,540] ({pool-2-thread-8} NotebookServer.java[afterStatusChange]:2302) - Job 20180907-130718_39068508 is finished, status: ERROR, exception: null, result: %text file: org.apache.spark.rdd.RDD[String] = file:///mnt/glusterfs/test/testfile MapPartitionsRDD[49] at textFile at <console>:51
org.apache.spark.SparkException: Job aborted.
  ...
  ... 64 elided
Caused by: java.io.IOException: Failed to rename DeprecatedRawLocalFileStatus{path=file:/mnt/glusterfs/test/testfile2/_temporary/0/task_20180914054253_0050_m_000018/part-00018; isDirectory=false; length=33554979; replication=1; blocksize=33554432; modification_time=1536903780000; access_time=0; owner=; group=; permission=rw-rw-rw-; isSymlink=false} to file:/mnt/glusterfs/test/testfile2/part-00018

我发现root用户拥有一些临时文件,而ulab用户拥有一些临时文件,如下所示:

bash-4.4# ls -l testfile2
total 32773
drwxr-xr-x    3 ulab     ulab          4096 Sep 14 05:42 _temporary
-rw-r--r--    1 ulab     ulab      33554979 Sep 14 05:44 part-00018
bash-4.4# ls -l testfile2/_temporary/
total 4
drwxr-xr-x  210 ulab     ulab          4096 Sep 14 05:44 0
bash-4.4# ls -l testfile2/_temporary/0
total 832
drwxr-xr-x    2 root     root          4096 Sep 14 05:42 task_20180914054253_0050_m_000000
drwxr-xr-x    2 root     root          4096 Sep 14 05:42 task_20180914054253_0050_m_000001
drwxr-xr-x    2 root     root          4096 Sep 14 05:42 task_20180914054253_0050_m_000002
drwxr-xr-x    2 root     root          4096 Sep 14 05:42 task_20180914054253_0050_m_000003
....

是否有任何设置可让ulab创建所有这些临时文件?因此我们可以在Spark驱动程序中使用多个用户来隔离特权。

0 个答案:

没有答案