hadoop:start-all.sh 启动时出错

时间:2020-12-09 08:27:50

测试版本:hadoop0.20.2

[hadoop@Master ~]$ start-all.sh

starting namenode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-namenode-Master.Hadoop.out
/usr/hadoop/bin/hadoop-daemon.sh: line 117: /usr/hadoop/bin/../logs/hadoop-hadoop-namenode-Master.Hadoop.out: Permission denied
head: cannot open ‘/usr/hadoop/bin/../logs/hadoop-hadoop-namenode-Master.Hadoop.out’ for reading: No such file or directory

192.168.1.3: starting datanode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-datanode-Slave1.Hadoop.out
192.168.1.4: starting datanode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-datanode-Slave2.Hadoop.out
192.168.1.5: starting datanode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-datanode-Slave3.Hadoop.out
192.168.1.105: starting secondarynamenode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-secondarynamenode-Master.Hadoop.out
192.168.1.105: /usr/hadoop/bin/hadoop-daemon.sh: line 117: /usr/hadoop/bin/../logs/hadoop-hadoop-secondarynamenode-Master.Hadoop.out: Permission denied
192.168.1.105: head: cannot open ‘/usr/hadoop/bin/../logs/hadoop-hadoop-secondarynamenode-Master.Hadoop.out’ for reading: No such file or directory
starting jobtracker, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-jobtracker-Master.Hadoop.out
/usr/hadoop/bin/hadoop-daemon.sh: line 117: /usr/hadoop/bin/../logs/hadoop-hadoop-jobtracker-Master.Hadoop.out: Permission denied
head: cannot open ‘/usr/hadoop/bin/../logs/hadoop-hadoop-jobtracker-Master.Hadoop.out’ for reading: No such file or directory

192.168.1.3: starting tasktracker, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-tasktracker-Slave1.Hadoop.out
192.168.1.4: starting tasktracker, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-tasktracker-Slave2.Hadoop.out
192.168.1.5: starting tasktracker, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-tasktracker-Slave3.Hadoop.out

[hadoop@Master ~]$ hadoop dfsadmin -report
14/02/05 00:12:56 INFO ipc.Client: Retrying connect to server: /192.168.1.105:9000. Already tried 0 time(s).
14/02/05 00:12:57 INFO ipc.Client: Retrying connect to server: /192.168.1.105:9000. Already tried 1 time(s).
14/02/05 00:12:58 INFO ipc.Client: Retrying connect to server: /192.168.1.105:9000. Already tried 2 time(s).
14/02/05 00:12:59 INFO ipc.Client: Retrying connect to server: /192.168.1.105:9000. Already tried 3 time(s).
14/02/05 00:13:00 INFO ipc.Client: Retrying connect to server: /192.168.1.105:9000. Already tried 4 time(s).


[root@Master usr]# ll
total 43748
dr-xr-xr-x.   2 root   root      53248 Feb  4 15:22 bin
drwxr-xr-x.   2 root   root       4096 Aug  7 17:10 games
drwxr-xr-x.  14 hadoop hadoop     4096 Feb  5 00:30 hadoop
-rw-r--r--.   1 root   root   44575568 Feb  4 13:47 hadoop-0.20.2.tar.gz
drwxr-xr-x.  35 root   root       4096 Feb  4 14:01 include
drwxr-xr-x.   3 root   root       4096 Feb  4 13:29 java
dr-xr-xr-x.  44 root   root       4096 Feb  4 14:10 lib
dr-xr-xr-x. 157 root   root      86016 Feb  4 15:22 lib64
drwxr-xr-x.  36 root   root      12288 Feb  4 15:22 libexec
drwxr-xr-x.  12 root   root       4096 Feb  4 12:49 local
dr-xr-xr-x.   2 root   root      20480 Feb  4 15:22 sbin
drwxr-xr-x. 244 root   root      12288 Feb  4 14:10 share
drwxr-xr-x.   4 root   root       4096 Feb  4 14:10 src
lrwxrwxrwx.   1 root   root         10 Feb  4 12:49 tmp -> ../var/tmp

[hadoop@Master hadoop]$ ll
total 4880
drwxr-xr-x.  2 root   root      4096 Feb  4 13:48 bin
-rw-rw-r--.  1 root   root     74035 Feb 19  2010 build.xml
drwxr-xr-x.  4 root   root      4096 Feb 19  2010 c++
-rw-rw-r--.  1 root   root    348624 Feb 19  2010 CHANGES.txt
drwxr-xr-x.  2 root   root      4096 Feb  4 21:08 conf
drwxr-xr-x. 13 root   root      4096 Feb 19  2010 contrib
drwxr-xr-x.  7 root   root      4096 Feb  4 13:47 docs
-rw-rw-r--.  1 root   root      6839 Feb 19  2010 hadoop-0.20.2-ant.jar
-rw-rw-r--.  1 root   root   2689741 Feb 19  2010 hadoop-0.20.2-core.jar
-rw-rw-r--.  1 root   root    142466 Feb 19  2010 hadoop-0.20.2-examples.jar
-rw-rw-r--.  1 root   root   1563859 Feb 19  2010 hadoop-0.20.2-test.jar
-rw-rw-r--.  1 root   root     69940 Feb 19  2010 hadoop-0.20.2-tools.jar
drwxr-xr-x.  2 root   root      4096 Feb  4 13:47 ivy
-rw-rw-r--.  1 root   root      8852 Feb 19  2010 ivy.xml
drwxr-xr-x.  5 root   root      4096 Feb  4 13:47 lib
drwxr-xr-x.  2 root   root      4096 Feb  4 13:47 librecordio
-rw-rw-r--.  1 root   root     13366 Feb 19  2010 LICENSE.txt
drwxr-xr-x.  3 root   root      4096 Feb  5 00:27 logs
-rw-rw-r--.  1 root   root       101 Feb 19  2010 NOTICE.txt
-rw-rw-r--.  1 root   root      1366 Feb 19  2010 README.txt
drwxr-xr-x. 15 root   root      4096 Feb  4 13:48 src
drwxrwxr-x.  2 hadoop hadoop    4096 Feb  5 00:30 tmp
drwxr-xr-x.  8 root   root      4096 Feb 19  2010 webapps


上述才知道是权限不够:

溯源:

chown -R hadoop:hadoop hadoop/

最后没加"/"


正确结果:

drwxr-xr-x.  2 hadoop hadoop    4096 Feb  4 13:48 bin
-rw-rw-r--.  1 hadoop hadoop   74035 Feb 19  2010 build.xml
drwxr-xr-x.  4 hadoop hadoop    4096 Feb 19  2010 c++
-rw-rw-r--.  1 hadoop hadoop  348624 Feb 19  2010 CHANGES.txt
drwxr-xr-x.  2 hadoop hadoop    4096 Feb  4 21:08 conf
drwxr-xr-x. 13 hadoop hadoop    4096 Feb 19  2010 contrib
drwxr-xr-x.  7 hadoop hadoop    4096 Feb  4 13:47 docs
-rw-rw-r--.  1 hadoop hadoop    6839 Feb 19  2010 hadoop-0.20.2-ant.jar
-rw-rw-r--.  1 hadoop hadoop 2689741 Feb 19  2010 hadoop-0.20.2-core.jar
-rw-rw-r--.  1 hadoop hadoop  142466 Feb 19  2010 hadoop-0.20.2-examples.jar
-rw-rw-r--.  1 hadoop hadoop 1563859 Feb 19  2010 hadoop-0.20.2-test.jar
-rw-rw-r--.  1 hadoop hadoop   69940 Feb 19  2010 hadoop-0.20.2-tools.jar
drwxr-xr-x.  2 hadoop hadoop    4096 Feb  4 13:47 ivy
-rw-rw-r--.  1 hadoop hadoop    8852 Feb 19  2010 ivy.xml
drwxr-xr-x.  5 hadoop hadoop    4096 Feb  4 13:47 lib
drwxr-xr-x.  2 hadoop hadoop    4096 Feb  4 13:47 librecordio
-rw-rw-r--.  1 hadoop hadoop   13366 Feb 19  2010 LICENSE.txt
drwxr-xr-x.  3 hadoop hadoop    4096 Feb  5 00:27 logs
-rw-rw-r--.  1 hadoop hadoop     101 Feb 19  2010 NOTICE.txt
-rw-rw-r--.  1 hadoop hadoop    1366 Feb 19  2010 README.txt
drwxr-xr-x. 15 hadoop hadoop    4096 Feb  4 13:48 src
drwxrwxr-x.  3 hadoop hadoop    4096 Feb  5 00:31 tmp
drwxr-xr-x.  8 hadoop hadoop    4096 Feb 19  2010 webapps

注意:

Slave1/Slave2/Slave3,也就是Datanode一样要改。

最后:

[hadoop@Master usr]$rm -rf /usr/hadoop/tmp
[hadoop@Master usr]$ mkdir /usr/hadoop/tmp
[hadoop@Master usr]$ rm -rf /tmp/hadoop*
[hadoop@Master usr]$ hadoop namenode -format
14/02/05 00:49:17 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = Master.Hadoop/192.168.1.105
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 0.20.2
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010
************************************************************/
14/02/05 00:49:17 INFO namenode.FSNamesystem: fsOwner=hadoop,hadoop
14/02/05 00:49:17 INFO namenode.FSNamesystem: supergroup=supergroup
14/02/05 00:49:17 INFO namenode.FSNamesystem: isPermissionEnabled=true
14/02/05 00:49:17 INFO common.Storage: Image file of size 96 saved in 0 seconds.
14/02/05 00:49:18 INFO common.Storage: Storage directory /usr/hadoop/tmp/dfs/name has been successfully formatted.
14/02/05 00:49:18 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at Master.Hadoop/192.168.1.105
************************************************************/
[hadoop@Master usr]$ start-all.sh
starting namenode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-namenode-Master.Hadoop.out
192.168.1.3: starting datanode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-datanode-Slave1.Hadoop.out
192.168.1.4: starting datanode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-datanode-Slave2.Hadoop.out
192.168.1.5: starting datanode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-datanode-Slave3.Hadoop.out
192.168.1.105: starting secondarynamenode, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-secondarynamenode-Master.Hadoop.out
starting jobtracker, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-jobtracker-Master.Hadoop.out
192.168.1.4: starting tasktracker, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-tasktracker-Slave2.Hadoop.out
192.168.1.3: starting tasktracker, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-tasktracker-Slave1.Hadoop.out
192.168.1.5: starting tasktracker, logging to /usr/hadoop/bin/../logs/hadoop-hadoop-tasktracker-Slave3.Hadoop.out