Eclipse writes file to HDFS error permission denied

Source: Internet
Author: User
Tags hadoop fs

Environment: Win7 Eclipse Hadoop 1.1.2

When the file creation is executed, the

That

Filesystem.mkdirs (Path);//Want to create a file on Hadoop error

Error:

Org.apache.hadoop.security.AccessControlException:Permission denied:user=administrator,access=write,inode= "tmp" : Root:supergroup:rwxr-xr-x

Reason:

1. The current user is administrator, not a Hadoop user

2. The default HDFs file directory for Hadoop is with permissions

Workaround:

1. In order for Eclipse to properly modify and delete files on the HDFs in the Hadoop cluster, modify the name of the WIN7 system administrator you are working with, which is usually "Administrator" and change it to "Hadoop". This user name is consistent with the Hadoop cluster user, and you should remember that all the machines in our Hadoop cluster have a common user--hadoop, and Hadoop runs with this user. In order not to be bothered with permissions, we can modify the name of the system administrator on the Win7, so as to avoid the problem that the user does not have permissions on the Hadoop cluster and so on, which can result in the creation and deletion of files from the Hadoop cluster in eclipse.

(1) Select "Local Users and Groups", expand "users", find the system administrator "Administrator", modify it to "Hadoop",
(2) "Log Off" or "Restart the computer" so that the administrator can use the name.

2. Modify the configuration of Hadoop

Join in the Conf/hdfs-site.xml

<property>
<name>dfs.permissions</name><value>false</value></property>

3. Modify Permissions: (Windows user Administrator does not have write access to the Hadoop directory)

To release the permissions for the Hadoop directory, the command is as follows: $ Hadoop fs-chmod 777/user/jifeng.

Eclipse writes file to HDFS error permission denied

Related Article

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.