Linux 搭建Hadoop集群执行命令start-dfs.sh报错 permission denied

时间:2020-12-01 09:32:55

错误信息如下:

ubuntu@ubuntu:~$ start-dfs.sh --config /usr/soft/hadoop-2.6.3/etc/hadoop_pseudo/Starting namenodes on [localhost]
localhost: mkdir: cannot create directory ‘/usr/soft/hadoop-2.6.3/logs’: Permission denied
localhost: chown: cannot access ‘/usr/soft/hadoop-2.6.3/logs’: No such file or directory
localhost: starting namenode, logging to /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-namenode-ubuntu.out
localhost: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 159: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-namenode-ubuntu.out: No such file or directory
localhost: head: cannot open ‘/usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-namenode-ubuntu.outfor reading: No such file or directory
localhost: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 177: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-namenode-ubuntu.out: No such file or directory
localhost: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 178: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-namenode-ubuntu.out: No such file or directory
localhost: mkdir: cannot create directory ‘/usr/soft/hadoop-2.6.3/logs’: Permission denied
localhost: chown: cannot access ‘/usr/soft/hadoop-2.6.3/logs’: No such file or directory
localhost: starting datanode, logging to /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-datanode-ubuntu.out
localhost: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 159: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-datanode-ubuntu.out: No such file or directory
localhost: head: cannot open ‘/usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-datanode-ubuntu.outfor reading: No such file or directory
localhost: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 177: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-datanode-ubuntu.out: No such file or directory
localhost: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 178: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-datanode-ubuntu.out: No such file or directory
Starting secondary namenodes [0.0.0.0]
0.0.0.0: mkdir: cannot create directory ‘/usr/soft/hadoop-2.6.3/logs’: Permission denied
0.0.0.0: chown: cannot access ‘/usr/soft/hadoop-2.6.3/logs’: No such file or directory
0.0.0.0: starting secondarynamenode, logging to /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-secondarynamenode-ubuntu.out
0.0.0.0: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 159: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-secondarynamenode-ubuntu.out: No such file or directory
0.0.0.0: head: cannot open ‘/usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-secondarynamenode-ubuntu.outfor reading: No such file or directory
0.0.0.0: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 177: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-secondarynamenode-ubuntu.out: No such file or directory
0.0.0.0: /usr/soft/hadoop-2.6.3/sbin/hadoop-daemon.sh: line 178: /usr/soft/hadoop-2.6.3/logs/hadoop-ubuntu-secondarynamenode-ubuntu.out: No such file or directory

解决方案:对hadoop安装目录执行命令:sudo chmod a+w *
对文件敞开权限