Prompt when using Hadoop fs-put localfile/user/xxx:
Put:permission Denied:user=root, Access=write, inode= "/user/shijin": hdfs:supergroup:drwxr-xr-x
Indicates: Insufficient permissions. There are two areas of authority involved. One is the permissions of the LocalFile file in the local file system, and one is the permissions on the/user/xxx directory on HDFs.
First look at the permissions of the/USER/XXX directory: drwxr-xr-x-HDFs Hdfds means it belongs to the HDFs user, the group is named HDFs
It is therefore necessary to use the sudo-u hdfs hadoop fs-put localfile/user/xxx to specify that the HDFs user be used to perform the upload command.
When pleased to perform sudo-u HDFs Hadoop fs-put localfile/user/xxx thought to be able to upload successfully, and error:
Put:localfile no such file or directory said to find local files LocalFile, but with LS clearly can see LocalFile, later in an article found that the issue is lcoalfile permissions.
Because I am now using the HDFs user to execute the command. The HDFs user does not have the relevant permissions for LocalFile. At this point, the problem is basically solved, is to let HDFs users have the relevant permissions to Lcoalfile
A simple way to solve this problem. Copy the file you want to upload directly to the/tmp directory. Because the/tmp directory has permissions of rwxrwxrwx. Then execute:
sudo-u HDFs Hadoop fs-put localfile/user/xxx uploaded successfully.
Resolving permissions issues when uploading files to HDFs from a Linux local file system