hadoop:org.apache.hadoop.security.accesscontrolexception:权限被拒绝

mepcadol  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(416)

在我的ubuntu 12.04.4上配置hadoop的方法如下:
http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/
当我执行这个命令时

./hadoop dfs -mkdir /In

我有一个错误:

mkdir: org.apache.hadoop.security.AccessControlException: Permission denied: user=hduser, access=WRITE, inode="":root:supergroup:rwxr-xr-x

在如何执行命令中:

sudo chmod 750 /app/hadoop/tmp

如果我给chmod 777,错误就不会改变。我不明白问题是什么。
p、 s:how-to和我的配置之间的唯一区别是,在how-to中,hadoop-env.sh如下所示:


# The java implementation to use.  Required.

 export JAVA_HOME=/usr/lib/jvm/java-6-sun

在我的配置中,我有:


# The java implementation to use.  Required.

 export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64

因为我使用openjdk。
另一个问题是,如果我发出命令./start-all.sh,我有以下输出:

Warning: $HADOOP_HOME is deprecated.

 starting namenode, logging to /home/hduser/hadoop/libexec/../logs/hadoop-hduser-namenode-ubuntu.out
 hduser@localhost's password: 
 localhost: starting datanode, logging to /home/hduser/hadoop/libexec/../logs/hadoop-hduser-datanode-ubuntu.out
 hduser@localhost's password: 
 localhost: starting secondarynamenode, logging to /home/hduser/hadoop/libexec/../logs/hadoop-hduser-secondarynamenode-ubuntu.out
 starting jobtracker, logging to /home/hduser/hadoop/libexec/../logs/hadoop-hduser-jobtracker-ubuntu.out
 hduser@localhost's password: 
 localhost: starting tasktracker, logging to /home/hduser/hadoop/libexec/../logs/hadoop-hduser-tasktracker-ubuntu.out

我不明白他为什么问我好几次。
如果我执行command./stop all.s,我有以下输出:

Warning: $HADOOP_HOME is deprecated.

 no jobtracker to stop
 hduser@localhost's password: 
 localhost: stopping tasktracker
 no namenode to stop
 hduser@localhost's password: 
 localhost: no datanode to stop
 hduser@localhost's password: 
 localhost: no secondarynamenode to stop

正常吗?

mzaanser

mzaanser1#

为了创建新的hdfs目录,您应该拥有具有适当权限的hadoop专用用户。按照以下步骤解决问题

$ sudo addgroup hadoop
$ sudo adduser --ingroup hadoop hduser

$ cd /usr/local
$ sudo tar xzf hadoop-1.0.3.tar.gz
$ sudo mv hadoop-1.0.3 hadoop
$ sudo chown -R hduser:hadoop hadoop

相关问题