我在Ubuntu 12.04上安装了Apache Hadoop 1.0.4。我按照http://hadoop.apache.org/docs/stable/single_node_setup.html上的说明进行了操作,并到达了“执行”部分。我在$ bin / start-all.sh上失败了,错误信息如下。我的用户名是anson。
$ start-all.sh
mkdir: cannot create directory `/var/log/hadoop/anson': Permission denied
chown: cannot access `/var/log/hadoop/anson': No such file or directory
mkdir: cannot create directory `/var/run/hadoop': Permission denied
starting namenode, logging to /var/log/hadoop/anson/hadoop-anson-namenode-anson-Ubuntu-T430.out
/usr/sbin/hadoop-daemon.sh: line 136: /var/run/hadoop/hadoop-anson-namenode.pid: No such file or directory
/usr/sbin/hadoop-daemon.sh: line 135: /var/log/hadoop/anson/hadoop-anson-namenode-anson-Ubuntu-T430.out: No such file or directory
head: cannot open `/var/log/hadoop/anson/hadoop-anson-namenode-anson-Ubuntu-T430.out' for reading: No such file or directory
localhost: mkdir: cannot create directory `/var/log/hadoop/anson': Permission denied
localhost: chown: cannot access `/var/log/hadoop/anson': No such file or directory
localhost: mkdir: cannot create directory `/var/run/hadoop': Permission denied
localhost: starting datanode, logging to /var/log/hadoop/anson/hadoop-anson-datanode-anson-Ubuntu-T430.out
localhost: /usr/sbin/hadoop-daemon.sh: line 136: /var/run/hadoop/hadoop-anson-datanode.pid: No such file or directory
localhost: /usr/sbin/hadoop-daemon.sh: line 135: /var/log/hadoop/anson/hadoop-anson-datanode-anson-Ubuntu-T430.out: No such file or directory
localhost: head: cannot open `/var/log/hadoop/anson/hadoop-anson-datanode-anson-Ubuntu-T430.out' for reading: No such file or directory
localhost: mkdir: cannot create directory `/var/log/hadoop/anson': Permission denied
localhost: chown: cannot access `/var/log/hadoop/anson': No such file or directory
localhost: mkdir: cannot create directory `/var/run/hadoop': Permission denied
localhost: starting secondarynamenode, logging to /var/log/hadoop/anson/hadoop-anson-secondarynamenode-anson-Ubuntu-T430.out
localhost: /usr/sbin/hadoop-daemon.sh: line 136: /var/run/hadoop/hadoop-anson-secondarynamenode.pid: No such file or directory
localhost: /usr/sbin/hadoop-daemon.sh: line 135: /var/log/hadoop/anson/hadoop-anson-secondarynamenode-anson-Ubuntu-T430.out: No such file or directory
localhost: head: cannot open `/var/log/hadoop/anson/hadoop-anson-secondarynamenode-anson-Ubuntu-T430.out' for reading: No such file or directory
mkdir: cannot create directory `/var/log/hadoop/anson': Permission denied
chown: cannot access `/var/log/hadoop/anson': No such file or directory
mkdir: cannot create directory `/var/run/hadoop': Permission denied
starting jobtracker, logging to /var/log/hadoop/anson/hadoop-anson-jobtracker-anson-Ubuntu-T430.out
/usr/sbin/hadoop-daemon.sh: line 136: /var/run/hadoop/hadoop-anson-jobtracker.pid: No such file or directory
/usr/sbin/hadoop-daemon.sh: line 135: /var/log/hadoop/anson/hadoop-anson-jobtracker-anson-Ubuntu-T430.out: No such file or directory
head: cannot open `/var/log/hadoop/anson/hadoop-anson-jobtracker-anson-Ubuntu-T430.out' for reading: No such file or directory
localhost: mkdir: cannot create directory `/var/log/hadoop/anson': Permission denied
localhost: chown: cannot access `/var/log/hadoop/anson': No such file or directory
localhost: mkdir: cannot create directory `/var/run/hadoop': Permission denied
localhost: starting tasktracker, logging to /var/log/hadoop/anson/hadoop-anson-tasktracker-anson-Ubuntu-T430.out
localhost: /usr/sbin/hadoop-daemon.sh: line 136: /var/run/hadoop/hadoop-anson-tasktracker.pid: No such file or directory
localhost: /usr/sbin/hadoop-daemon.sh: line 135: /var/log/hadoop/anson/hadoop-anson-tasktracker-anson-Ubuntu-T430.out: No such file or directory
localhost: head: cannot open `/var/log/hadoop/anson/hadoop-anson-tasktracker-anson-Ubuntu-T430.out' for reading: No such file or directory
anson@anson-Ubuntu-T430:~$ cd /var/run/hadoop
-bash: cd: /var/run/hadoop: No such file or directory
答案 0 :(得分:1)
听起来您安装了Hadoop Debian软件包,并且您尝试以非root用户身份运行start-all.sh
。
以下是一些想法:
sudo start-all.sh
而不是bin/start-all.sh
。如果你使用tarball选项,首先清除Debian软件包:
sudo apt-get purge hadoop
确保您没有设置任何特定于Hadoop的环境变量。这应该什么都不返回:
set | grep HADOOP
如果您从该命令获得任何输出,请重新启动或手动unset
包含HADOOP
的任何环境变量。
此时你应该能够爆炸tarball并遵循所写的“伪分布式操作”指南(以及作为非root用户)。
有两个tarball。 hadoop-1.0.4.tar.gz
包含来源和文档,hadoop-1.0.4-bin.tar.gz
没有。要么有效。
答案 1 :(得分:0)
您用于启动hadoop的用户没有/var/log
的权限。检查用户在/var/log/
上的权限。
另一种方法是,您可以在hadoop.tmp.dir
配置中更改hadoop基础目录。
答案 2 :(得分:0)
将目录的所有者以及权限更改为755