Apache spark 尝试将数据帧spark保存到hdfs文件时出错

Apache spark 尝试将数据帧spark保存到hdfs文件时出错,apache-spark,pyspark,apache-spark-sql,spark-streaming,Apache Spark,Pyspark,Apache Spark Sql,Spark Streaming,我在用ubuntu 当我尝试将数据帧保存到HDFS(spark scala)时: procesed.write.format(“json”).save(“hdfs://localhost:54310/mydata/enedis/POC/processed.json)) 我犯了这个错误 由以下原因引起:org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException):权限被拒绝:user

我在用ubuntu

当我尝试将数据帧保存到HDFS(spark scala)时: procesed.write.format(“json”).save(“hdfs://localhost:54310/mydata/enedis/POC/processed.json))

我犯了这个错误


由以下原因引起:org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException):权限被拒绝:user=root,access=WRITE,inode=“/mydata/enedis/POC”:hadoop\u amine:supergroup:drwxr-xr-x

您试图以
root
用户而不是hdfs目录(/mydata/enedis/POC)的形式写入数据拥有
hadoop\u amine
用户写入目录的权限

#login as hadoop_amine user then execute below command
hdfs dfs –chmod -R 777  /mydata/enedis/POC
更改HDFS目录上的,以允许
root
用户写入
/mydata/enedis/POC
目录

#login as hadoop_amine user then execute below command
hdfs dfs –chmod -R 777  /mydata/enedis/POC

(或)


使用
hadoop\u amine
user初始化spark shell,则无需更改目录的权限。

谢谢,它工作得很好:),你能告诉我如何使用hadoop\u amine初始化spark shell吗,因为我只使用intelliji上的spark dependency。我想我错误地删除了你的评论:s,我将打开一个新的线程初始化火花shell@aminedjeddi当然这是一个好主意,所以这个问题将得到更多的关注。。!我打开了新的线程
#login as hadoop_amine user then execute below command
hdfs dfs –chmod -R 777  /mydata/enedis/POC