Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

persist permissions to all files in directory HDFS

Tags:

hadoop

hdfs

I am trying to do a chmod 755 on all the directories and files in an HDFS directory but it wont persist all the way down.

for example, if I have a directory like this:

/home/set1/data1/file1.txt

I need to do this so my app can access it:

haddop fs -chmod 755 /home/set1/*
haddop fs -chmod 755 /home/set1/data1/*
haddop fs -chmod 755 /home/set1/data1/file*
haddop fs -chmod 755 /home/set1/data2/*
haddop fs -chmod 755 /home/set1/data2/file*
haddop fs -chmod 755 /home/set1/data3/*
haddop fs -chmod 755 /home/set1/data3/file*

how do I get the permission to set for each directory and file in the path in HDFS?

like image 969
lightweight Avatar asked Nov 05 '15 05:11

lightweight


People also ask

How do I give recursive permission in HDFS?

Changing HDFS File Permissions You must be a super user or the owner of a file or directory to change its permissions. With the chgrp, chmod and chown commands you can specify the –R option to make recursive changes through the directory structure you specify.

What are the different file permissions in HDFS for files or directory levels?

The file or directory has separate permissions for the user that is the owner, for other users that are members of the group, and for all other users. For files, the r permission is required to read the file, and the w permission is required to write or append to the file.

How do I check permissions for HDFS folder?

-chmod that stands for change mode command is used for changing the permission for the files in our HDFS. The first list down the directories available in our HDFS and have a look at the permission assigned to each of this directory. You can list the directory in your HDFS root with the below command.


1 Answers

Use "-R" (Recursive) option.

hadoop fs -chmod -R 755 /home/set1/data1/
like image 50
Manjunath Ballur Avatar answered Nov 15 '22 07:11

Manjunath Ballur