3

我在 Ubuntu 12.04 上安装了 Apache Hadoop 1.0.4。我按照http://hadoop.apache.org/docs/stable/single_node_setup.html上的说明,到达了“执行”部分。我在 $ bin/start-all.sh 上失败了,错误消息如下。我的用户名是安森。

$ 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
4

3 回答 3

1

听起来您安装了 Hadoop Debian 软件包,并且您正试图以start-all.sh非 root 用户身份运行。

这里有一些想法:

  1. 尝试按照“独立操作”说明进行操作,该说明应按书面说明工作。
  2. 尝试按照编写的“伪分布式操作”部分进行操作,但有一个例外sudo start-all.sh而不是bin/start-all.sh.
  3. 尝试完全卸载 Debian 软件包并改用 Hadoop 发行版 tarball。

如果您使用 tarball 选项,请首先清除 Debian 软件包:

sudo apt-get purge hadoop

确保您没有设置任何特定于 Hadoop 的环境变量。这应该什么都不返回:

set | grep HADOOP

如果您从该命令获得任何输出,请重新启动或手动unset任何包含HADOOP.

此时,您应该能够分解 tarball 并按照所写的“伪分布式操作”指南(并且作为非 root 用户)进行操作。

有两个压缩包。hadoop-1.0.4.tar.gz包括源和文档,hadoop-1.0.4-bin.tar.gz不包括。要么工作。

于 2013-02-13T22:08:46.610 回答
0

将目录的所有者和权限更改为 755

于 2012-11-17T22:15:13.277 回答
0

您用于启动 hadoop 的用户对/var/log. 检查用户对/var/log/.

hadoop.tmp.dir另一种方式,您可以跨配置更改 hadoop 基础目录 。

于 2012-11-17T05:29:13.710 回答