2
votes

I am trying to write a file to HDFS cluster from My windows machine but getting following error

org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=..., access=WRITE , inode="/user/hadoop/Hadoop_File.txt":hdfs:hdfs:-rw-r--r--

In my hadoop configuration

 hadoop.security.auth_to_local is set to DEFAULT 
 hadoop.security.authentication is set to SIMPLE

if i mention user name as "hdfs" by doing

System.setProperty("HADOOP_USER_NAME", "hdfs");

everything works fine .

but if the policy is simple it means no authentication it should allow any user to create file Help me in understanding why this is happening

2

2 Answers

1
votes

I got the answer :) you have to configure dfs.permissions.enable = false ,it was true in my case once it is turned off ,it doesn't complains for any user used

0
votes

Simple authentication in Hadoop means you don't need to prove who you are, for example with a password or token, but you still need to say who you are. Whichever user you assert yourself to be, Hadoop will believe you and adopt user name for the operation you request.

There are still permissions in place on HDFS (you can see that with hdfs:hdfs:-rw-r--r-- in your message above), so you need to assert yourself to be a user who has the necessary permissions for your operation, which is what you did with System.setProperty("HADOOP_USER_NAME", "hdfs");

The short version is, identity is not the same as authentication :)