Resolving permissions issues when uploading files to HDFs from a Linux local file system

Source: Internet
Author: User
Tags hadoop fs

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.