Essex
Essex

Reputation: 6138

Permission denied for Browsing HDFS

I'm learning Hadoop and Spark environment and I installed both environment with success.

But, when I want to go to HDFS management (localhost:50070/explorer) and I want to click on tmp, I get this issue :

Permission denied: user=dr.who, access=READ_EXECUTE, inode="/tmp":valentin:supergroup:drwx-wx-wx

enter image description here

I tried to change permissions with :

hdfs dfs –chmod –R 755 /valentin

But I get :

–chmod: Unknown command

It strange because I have :

valentin@hadoop:~/hadoop-2.9.0$ bin/hdfs dfs -ls /
18/02/06 11:55:38 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 1 items
drwx-wx-wx   - valentin supergroup          0 2018-02-06 11:36 /tmp

Could you help me to find a solution in order to upload .txt file into my tmp directory ?

I have in .bashrc :

export HADOOP_HOME=/home/valentin/hadoop-2.9.0
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"

export JAVA_HOME="/usr/lib/jvm/java-8-oracle"

Upvotes: 0

Views: 3638

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191953

That error is from Bash, not the Hadoop CLI

Your hyphen is wrong. You gave and it expected - (yes there is a difference)

This commonly happens when you copy terminal commands off random websites that don't have good code formatting.

And you gave the wrong directory if you wanted to set /tmp

You might also want to find out what "fs.permissions.umask-mode" is set to in hdfs site

It is set to 022 by default, but looks like you got it to be 011

tmp can be globally RWX

hadoop dfs -chmod -R 1777 /tmp

Once you have all that working again, if you want to actually run mapreduce and stuff, you need to

hadoop fs -mkdir -p /user/valentin
hadoop fs -chmod -R 750 /user/valentin
hadoop fs -chown -R  valentin  /user/valentin

Upvotes: 1

Related Questions