Hadoop hdfs "permission denied" error when I try to make new directory

0 votes

I am trying to make a new directory in my hdfs using the following command:

hadoop fs -mkdir sample

I am getting this error:

mkdir: Permission denied: user=cloudera, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x

Nov 22, 2018 in Big Data Hadoop by slayer
• 29,050 points
883 views

1 answer to this question.

0 votes

This is because you dont have enough permission to create directory in hdfs. Try running this as sudo:

sudo -u hdfs hadoop fs -mkdir /sample

Alternatively if you want any user to be able to do this, you can change the permission property:

<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
</property>

But this is not recommended because it compromises security.

answered Nov 22, 2018 by Omkar
• 67,290 points

Related Questions In Big Data Hadoop

+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
2 answers

What does hadoop fs -du command gives as output?

du command is used for to see ...READ MORE

answered Jul 23 in Big Data Hadoop by Lokesh Singh
750 views
0 votes
1 answer

How can I write text in HDFS using CMD?

Hadoop put & appendToFile only reads standard ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,290 points
72 views
0 votes
1 answer

What is the command to find the free space in HDFS?

You can use dfsadmin which runs a ...READ MORE

answered Apr 29, 2018 in Big Data Hadoop by Shubham
• 13,290 points
146 views
0 votes
1 answer

How to find the used cache in HDFS

hdfs dfsadmin -report This command tells fs ...READ MORE

answered May 4, 2018 in Big Data Hadoop by Shubham
• 13,290 points
186 views
0 votes
1 answer

Getting error when writing to HDFS. Unable to load native-hadoop library for your platform

Try this: sudo service hadoop-master restart After that try ...READ MORE

answered Dec 19, 2018 in Big Data Hadoop by Omkar
• 67,290 points
118 views
0 votes
1 answer

Hadoop: How to copy directory from local system to hdfs using Java code?

Just use the FileSystem's copyFromLocalFile method. If the source Path ...READ MORE

answered Nov 14, 2018 in Big Data Hadoop by Omkar
• 67,290 points
409 views