Hadoop单节点集群错误

时间:2015-04-06 18:49:52

标签: java linux bash ubuntu hadoop

我已经完成了从本网站安装Hadoop的每一步 https://www.digitalocean.com/community/tutorials/how-to-install-hadoop-on-ubuntu-13-10

除了使用start-dfs.sh启动Hadoop的最后一步,所有步骤都很顺利,并且出现了很多错误。请帮忙。 错误是:

15/04/07 00:08:16 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [localhost]

localhost: mkdir: cannot create directory ‘/usr/local/hadoop/logs’: Permission denied

localhost: chown: cannot access ‘/usr/local/hadoop/logs’: No such file or directory

localhost: starting namenode, logging to /usr/local/hadoop/logs/hadoop-tushar-namenode-tushar-VirtualBox.out

localhost: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 159: /usr/local/hadoop/logs/hadoop-tushar-namenode-tushar-VirtualBox.out: No such file or directory

localhost: head: cannot open ‘/usr/local/hadoop/logs/hadoop-tushar-namenode-tushar-VirtualBox.out’ for reading: No such file or directory

localhost: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 177: /usr/local/hadoop/logs/hadoop-tushar-namenode-tushar-VirtualBox.out: No such file or directory

localhost: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 178: /usr/local/hadoop/logs/hadoop-tushar-namenode-tushar-VirtualBox.out: No such file or directory

localhost: mkdir: cannot create directory ‘/usr/local/hadoop/logs’: Permission denied

localhost: chown: cannot access ‘/usr/local/hadoop/logs’: No such file or directory

localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-tushar-datanode-tushar-VirtualBox.out

localhost: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 159: /usr/local/hadoop/logs/hadoop-tushar-datanode-tushar-VirtualBox.out: No such file or directory

localhost: head: cannot open ‘/usr/local/hadoop/logs/hadoop-tushar-datanode-tushar-VirtualBox.out’ for reading: No such file or directory

localhost: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 177: /usr/local/hadoop/logs/hadoop-tushar-datanode-tushar-VirtualBox.out: No such file or directory

localhost: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 178: /usr/local/hadoop/logs/hadoop-tushar-datanode-tushar-VirtualBox.out: No such file or directory

Starting secondary namenodes [0.0.0.0]

0.0.0.0: mkdir: cannot create directory ‘/usr/local/hadoop/logs’: Permission denied

0.0.0.0: chown: cannot access ‘/usr/local/hadoop/logs’: No such file or directory

0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-tushar-secondarynamenode-tushar-VirtualBox.out

0.0.0.0: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 159: /usr/local/hadoop/logs/hadoop-tushar-secondarynamenode-tushar-VirtualBox.out: No such file or directory

0.0.0.0: head: cannot open ‘/usr/local/hadoop/logs/hadoop-tushar-secondarynamenode-tushar-VirtualBox.out’ for reading: No such file or directory

0.0.0.0: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 177: /usr/local/hadoop/logs/hadoop-tushar-secondarynamenode-tushar-VirtualBox.out: No such file or directory

0.0.0.0: /usr/local/hadoop/sbin/hadoop-daemon.sh: line 178: /usr/local/hadoop/logs/hadoop-tushar-secondarynamenode-tushar-VirtualBox.out: No such file or directory
15/04/07 00:08:34 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

1 个答案:

答案 0 :(得分:2)

您的用户帐户对/usr/local/hadoop目录没有正确的权限,因此Hadoop在尝试创建其日志时失败。尝试运行sudo chown -R <username> /usr/local/hadoop您的用户名在哪里。要获取用户名,可以使用whoami命令。