Why does “hadoop fs -mkdir” fail with Permission Denied?

后端 未结 6 806
甜味超标
甜味超标 2020-12-28 18:22

I am using Cloudera on a VM machine that I am playing around with. Unfortunately I am having issues copying data to the HDFS, I am getting the following:

[cl         


        
6条回答
  •  攒了一身酷
    2020-12-28 19:02

    When you execute the above command, if hdfs home directory(/user/cloudera) is not there then that directory will be created first then the directory input will be created under /user/cloudera

    For giving permission for cloudera user to create it's own directory, you got to give permission. hdfs user is the admin user in hdfs switch to hdfs then execute the following command

    [hdfs@localhost~]$ hadoop fs -mkdir /user/cloudera ; hadoop fs -chmod 777  /user/cloudera
    

    Or

    if you are not too concerned about hdfs security you disable hdfs permission by setting the below property to false in hdfs-site.xml

    
    dfs.permissions.enabled
    false
    
    

    after setting this property to false hdfs needs to be restarted.

提交回复
热议问题