![在 Hadoop 中启动单节点集群时出现“权限被拒绝”错误](https://linux22.com/image/1092737/%E5%9C%A8%20Hadoop%20%E4%B8%AD%E5%90%AF%E5%8A%A8%E5%8D%95%E8%8A%82%E7%82%B9%E9%9B%86%E7%BE%A4%E6%97%B6%E5%87%BA%E7%8E%B0%E2%80%9C%E6%9D%83%E9%99%90%E8%A2%AB%E6%8B%92%E7%BB%9D%E2%80%9D%E9%94%99%E8%AF%AF.png)
我正在 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 安装的登录名和目录)