KarelV
KarelV

Reputation: 507

Setting permissions for cloudera hadoop

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.

Upvotes: 9

Views: 14235

Answers (4)

Jack Sparrow
Jack Sparrow

Reputation: 81

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

Upvotes: 0

Rajesh
Rajesh

Reputation: 1

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

Upvotes: 0

Amitesh Ranjan
Amitesh Ranjan

Reputation: 1532

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

Upvotes: 0

KarelV
KarelV

Reputation: 507

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>

Upvotes: 16

Related Questions