9

I installed coudera hadoop 4 on a cluster of about 20 nodes. Using cloudera manager it went really smooth and all, but when I want to create an input directory using hadoop fs -mkdir input I get the following error: mkdir: Permission denied: user=root, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x Looks like a classic wrong permissions case but I have no clue where to start to fix this. I found this document which I think would solve my problem if I knew what to do with it. For starters I don't know whether I am using MapReduce v1 of v2 (I don't see any yarn service in my cloudera manager so my guess would be v1 (?)). Second, since the whole installation was automatic I don't know what is installed and where.

Could anyone point me towards some easy steps to solve my problem? I'm really looking for the easiest solution here, I don't care at all about security since it is only a test. If I could give all users all possible permissions that would be fine.

4 Answers 4

16

I solved my problem: In cloudera manager, go to hdfs configuration under advanced and put the following code in HDFS Service Configuration Safety Valve:

<property>
  <name>dfs.permissions</name>
  <value>false</value>
</property>
3
  • 11
    Thank you! Now That needs to be set in the GUI. localhost:7180 -> hdfs1 -> Configuration -> View and Edit -> Uncheck "Check HDFS Persmissions". Restart VM.
    – Shehaaz
    Jul 16, 2013 at 3:07
  • 2
    alternatively this works "sudo -u hdfs hadoop fs -mkdir input" Apr 11, 2014 at 3:43
  • This does solve the issue - but is turning off permissions a "nuclear" solution? Much like turning off the firewall -- it doesn't actually solve the problem? Feb 28, 2017 at 1:14
0

Changing dfs.permission is always a solution but you can also try changing the user. In my system, the writing permission is assigned only to 'hdfs' user. The user can be changed by the following command:

su hdfs
1
  • hdfs user doesnt have a password in this case and not in the sudoers list u need to add it to sudoers list , first , and u will need the password for that Jun 21, 2016 at 16:52
0

hdfs1 -> Configuration -> View and Edit -> Uncheck "Check HDFS Persmissions" this worked thanks Shehaz

0

1.Do not modify dfs.permissions.Keep its value as true.

2.Add groups for a particular user if you required.( optional)

groupadd development groupadd production

echo "Group production and development are created."

create user with existing groups and assign hdfs directory to use

useradd -g development clouddev3 sudo -u hdfs hadoop fs -mkdir -p /user/clouddev3 sudo -u hdfs hadoop fs -chown -R clouddev3:development /user/clouddev3 echo "User clouddev3 created and owns /user/clouddev3 directory in hdfs"

Now login with clouddev3 user and try,

hdfs dfs -ls /user/clouddev3

or hdfs dfs -ls

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.