Permission denied at hdfs

前端 未结 6 938
眼角桃花
眼角桃花 2020-11-27 12:48

I am new to hadoop distributed file system, I have done complete installation of hadoop single node on my machine.but after that when i am going to upload data to hdfs it gi

6条回答
  •  天涯浪人
    2020-11-27 13:20

    I had similar situation and here is my approach which is somewhat different:

     HADOOP_USER_NAME=hdfs hdfs dfs -put /root/MyHadoop/file1.txt /
    

    What you actually do is you read local file in accordance to your local permissions but when placing file on HDFS you are authenticated like user hdfs. You can do this with other ID (beware of real auth schemes configuration but this is usually not a case).

    Advantages:

    1. Permissions are kept on HDFS.
    2. You don't need sudo.
    3. You don't need actually appropriate local user 'hdfs' at all.
    4. You don't need to copy anything or change permissions because of previous points.

提交回复
热议问题