I am trying to upload a file on Hadoop HDFS with the command:
hadoop fs -put test.txt /mydir/
But its throwing following error:
mkdir: Permission denied: user=root, access=WRITE,inode="/mydir/":hdfs:hdfs:drwxr-xr-x
What is this error and how to resolve it?
This error is due to the fact that current user "root" does not have permission to write on the HDFS.
The directory of HDFS is owned by the user "hdfs" with the 755 permission. You will be able to upload file if you chage user to hdfs with following command:
After running this on console you run command to upload file and it will be uploaded correctly.
Hope this helps.
You will find all important commands of Hadoop at the tutorial page: Hadoop shell commands.
Learn Hadoop command with the help of above tutorial.
You can also disable security if you are in development environment with adding following property:
<property> <name>dfs.permissions</name> <value>false</value> </property>
In the hdfs-site.xml file.
But this is not recommended in production environment.
Are you in search of Big Data and Hdoop tutorials? Looking for examples of Hadoop and Big Data Analytics.
On the above page you will find many tutorials.