-->
  • Recent Articles

    Permission denied: user=root, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x

    Permission denied: user=root, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x

    hadoop

    The /user/ directory is owned by "hdfs" with 755 permissions. As a result only hdfs can write to that directory. So to overcome this situation we have two ways.

    1. Give Privileges to to root user.

    OR 

    2. Escalate privilege of root user to be able to write in the /user.

    Let's check the option 2 here:

    sudo -u hdfs hadoop fs -mkdir /user/
    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/".

    No comments