Created
October 23, 2015 02:03
-
-
Save pavlov99/a9af5871a1db578de16e to your computer and use it in GitHub Desktop.
create user directory in hadoop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The /user/ directory is owned by "hdfs" with 755 permissions. As a result only hdfs can write to that directory. Unlike unix/linux, hdfs is the superuser and not root. So you would need to do this: | |
sudo -u hdfs hadoop fs -mkdir /user/,,myfile,, | |
sudo -u hdfs hadoop fs -put myfile.txt /user/,,/,, | |
If you want to create a home directory for root so you can store files in his directory, do: | |
sudo -u hdfs hadoop fs -mkdir /user/root | |
sudo -u hdfs hadoop fs -chown root /user/root | |
Then as root you can do "hadoop fs -put file /user/root/". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment