我是 Hadoop 新手,我正在经历提到的安装过程这里。我已经hadoop-1.2.1
在我的系统上安装了。配置完所有内容后,当我尝试启动单节点集群时,出现以下错误:
$ /usr/local/hadoop-1.2.1/bin/start-all.sh
mkdir: cannot create directory ‘/usr/local/hadoop-1.2.1/libexec/../logs’: Permission denied
chown: cannot access ‘/usr/local/hadoop-1.2.1/libexec/../logs’: No such file or directory
starting namenode, logging to /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-namenode-asad-HP-15-Notebook-PC.out
/usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 137: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-namenode-asad-HP-15-Notebook-PC.out: No such file or directory
head: cannot open ‘/usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-namenode-asad-HP-15-Notebook-PC.out’ for reading: No such file or directory
/usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 147: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-namenode-asad-HP-15-Notebook-PC.out: No such file or directory
/usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 148: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-namenode-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: mkdir: cannot create directory ‘/usr/local/hadoop-1.2.1/libexec/../logs’: Permission denied
localhost: chown: cannot access ‘/usr/local/hadoop-1.2.1/libexec/../logs’: No such file or directory
localhost: starting datanode, logging to /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-datanode-asad-HP-15-Notebook-PC.out
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 137: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-datanode-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: head: cannot open ‘/usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-datanode-asad-HP-15-Notebook-PC.out’ for reading: No such file or directory
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 147: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-datanode-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 148: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-datanode-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: mkdir: cannot create directory ‘/usr/local/hadoop-1.2.1/libexec/../logs’: Permission denied
localhost: chown: cannot access ‘/usr/local/hadoop-1.2.1/libexec/../logs’: No such file or directory
localhost: starting secondarynamenode, logging to /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-secondarynamenode-asad-HP-15-Notebook-PC.out
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 137: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-secondarynamenode-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: head: cannot open ‘/usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-secondarynamenode-asad-HP-15-Notebook-PC.out’ for reading: No such file or directory
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 147: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-secondarynamenode-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 148: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-secondarynamenode-asad-HP-15-Notebook-PC.out: No such file or directory
mkdir: cannot create directory ‘/usr/local/hadoop-1.2.1/libexec/../logs’: Permission denied
chown: cannot access ‘/usr/local/hadoop-1.2.1/libexec/../logs’: No such file or directory
starting jobtracker, logging to /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-jobtracker-asad-HP-15-Notebook-PC.out
/usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 137: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-jobtracker-asad-HP-15-Notebook-PC.out: No such file or directory
head: cannot open ‘/usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-jobtracker-asad-HP-15-Notebook-PC.out’ for reading: No such file or directory
/usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 147: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-jobtracker-asad-HP-15-Notebook-PC.out: No such file or directory
/usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 148: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-jobtracker-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: mkdir: cannot create directory ‘/usr/local/hadoop-1.2.1/libexec/../logs’: Permission denied
localhost: chown: cannot access ‘/usr/local/hadoop-1.2.1/libexec/../logs’: No such file or directory
localhost: starting tasktracker, logging to /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-tasktracker-asad-HP-15-Notebook-PC.out
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 137: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-tasktracker-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: head: cannot open ‘/usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-tasktracker-asad-HP-15-Notebook-PC.out’ for reading: No such file or directory
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 147: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-tasktracker-asad-HP-15-Notebook-PC.out: No such file or directory
localhost: /usr/local/hadoop-1.2.1/bin/hadoop-daemon.sh: line 148: /usr/local/hadoop-1.2.1/libexec/../logs/hadoop-hduser-tasktracker-asad-HP-15-Notebook-PC.out: No such file or directory
答案1
我只是想以 root 身份运行这个命令。这就是我收到该错误的原因。现在在sudo
命令前面添加后就可以正常工作,即:
sudo /usr/local/hadoop-1.2.1/bin/start-all.sh