1
votes

To my practise on Hadoop HDFS, I understood that on creating a user say u1 and trying to put a file from the local file system to the HDFS, it searches for the directory /user/u1 (by default) with write permissions on the HDFS file system.

By default all the users search their (HDFS home)directories in the /user directory on the HDFS. My doubt is can I change the default HDFS home directory to /user directory from something other.

Also is there any possibility to have different locations for HDFS home directories for different users as we do in the case of Linux users i.e for user1 the HDFS home directory should be /home1/user1 and for *user2 the HDFS home directory should be as /home2/user2.

Please correct me if my assumptions are wrong.

2
possible duplicate of HDFS Home Directory - vishnu viswanath
Sonic, can you provide me a link where step by step procedure is there to rebuild the source such that the required changes would take place as per the suggestions in stackoverflow.com/questions/10069568/hdfs-home-directory - Shashikanth Komandoor

2 Answers

0
votes

when we use different user login hue,it will show you different path.just like "hdfs" user login path is "/user/hdfs". so if you know the user info you can control it by yourself such as make directory for user: "/user/{username}"

0
votes

The hadoop-env.sh script that gets ran for your HDFS CLI commands will always pick-up HADOOP_USER_NAME for a non-Kerberized cluster.

Therefore, if you are user foo, and you added export HADOOP_USER_NAME=bar into your .bashrc, for example, and did hdfs dfs -ls, then it will search for /user/bar on HDFS.

You can also "become" any HDFS user at runtime and wipe all of HDFS like so HADOOP_USER_NAME=hdfs hdfs dfs -rm -R -f -skipTrash /