Community Articles
Find and share helpful community-sourced technical articles
Labels (1)
Contributor

Generally we are used to use chown/chmod to change permissions. When we try chown/chmod on a directory which contains some x million objects it takes very long sometime even days. So to reduce the time and make the changes in one command instead of 2 chown and chmod, you can use DistCh faster then regular chown and chmod.

Below is the command to use DistCh

hadoop jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-extras.jar org.apache.hadoop.tools.DistCh 
java org.apache.hadoop.tools.DistCh [OPTIONS] <path:owner:group:permission>

The values of owner, group and permission can be empty.
Permission is a octal number.

OPTIONS:
-f <urilist_uri>       Use list at <urilist_uri> as src list
-i                     Ignore failures
-log <logdir>          Write logs to <logdir>
Generic options supported are
-conf <configuration file>     specify an application configuration file
-D <property=value>            use value for given property
-fs <local|namenode:port>      specify a namenode
-jt <local|resourcemanager:port>    specify a ResourceManager
-files <comma separated list of files>    specify comma separated files to be copied to the map reduce cluster
-libjars <comma separated list of jars>    specify comma separated jar files to include in the classpath.
-archives <comma separated list of archives>    specify comma separated archives to be unarchived on the compute machines.

337 Views
Comments
New Member

I use this tool to get a set hdfs permission https://github.com/hadoopol/hdfs_copy_permission

Don't have an account?
Version history
Revision #:
1 of 1
Last update:
‎01-26-2018 06:05 PM
Updated by:
 
Contributors
Top Kudoed Authors