在 Hadoop 中启动单节点集群时出现“权限被拒绝”错误

在 Hadoop 中启动单节点集群时出现“权限被拒绝”错误

我正在 Ubuntu 10.10 中工作,并尝试在 Hadoop 中启动单节点集群。

hadoop@abraham-Dimension-3000:/usr/local/hadoop$ bin/start-all.sh
mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied
starting namenode, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-namenode-abraham-Dimension-3000.out
/usr/local/hadoop/bin/hadoop-daemon.sh: line 117: /usr/local/hadoop/bin/../logs/hadoop-hadoop-namenode-abraham-Dimension-3000.out: No such file or directory
head: cannot open `/usr/local/hadoop/bin/../logs/hadoop-hadoop-namenode-abraham-Dimension-3000.out' for reading: No such file or directory
localhost: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied
localhost: starting datanode, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-datanode-abraham-Dimension-3000.out
localhost: /usr/local/hadoop/bin/hadoop-daemon.sh: line 117: /usr/local/hadoop/bin/../logs/hadoop-hadoop-datanode-abraham-Dimension-3000.out: No such file or directory
localhost: head: cannot open `/usr/local/hadoop/bin/../logs/hadoop-hadoop-datanode-abraham-Dimension-3000.out' for reading: No such file or directory
localhost: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied
localhost: starting secondarynamenode, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-secondarynamenode-abraham-Dimension-3000.out
localhost: /usr/local/hadoop/bin/hadoop-daemon.sh: line 117: /usr/local/hadoop/bin/../logs/hadoop-hadoop-secondarynamenode-abraham-Dimension-3000.out: No such file or directory
localhost: head: cannot open `/usr/local/hadoop/bin/../logs/hadoop-hadoop-secondarynamenode-abraham-Dimension-3000.out' for reading: No such file or directory
mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied
starting jobtracker, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-jobtracker-abraham-Dimension-3000.out
/usr/local/hadoop/bin/hadoop-daemon.sh: line 117: /usr/local/hadoop/bin/../logs/hadoop-hadoop-jobtracker-abraham-Dimension-3000.out: No such file or directory
head: cannot open `/usr/local/hadoop/bin/../logs/hadoop-hadoop-jobtracker-abraham-Dimension-3000.out' for reading: No such file or directory
localhost: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied
localhost: starting tasktracker, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-tasktracker-abraham-Dimension-3000.out
localhost: /usr/local/hadoop/bin/hadoop-daemon.sh: line 117: /usr/local/hadoop/bin/../logs/hadoop-hadoop-tasktracker-abraham-Dimension-3000.out: No such file or directory
localhost: head: cannot open `/usr/local/hadoop/bin/../logs/hadoop-hadoop-tasktracker-abraham-Dimension-3000.out' for reading: No such file or directory
hadoop@abraham-Dimension-3000:/usr/local/hadoop$ 

我不知道我做错了什么或这些错误意味着什么。

hadoop@abraham-Dimension-3000:/usr/local/hadoop$ jps
5099 Jps

有人可以诊断一下这个问题吗?

答案1

这些错误表明存在权限问题。

确保 Hadoop 用户具有适当的权限/usr/local/hadoop。尝试:

sudo chown -R hadoop /usr/local/hadoop/

答案2

您使用非 hadoop 用户指定了 hadoop 文件系统的工作目录,因此请将具有读取、写入权限的目录设置为 hadoop 用户,或者更改目录的权限
尝试 ::

sudo chown -R hadoop-user /user/hadoop_project/

或者

sudo chmod 777 /user/hadoop_project

其中 'hadoop-user' 是 hadoop 环境的登录名。'hadoop-project' 是 hadoop 文件系统的指定工作目录。(指定您用于 hadoop 安装的登录名和目录)

相关内容