1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
2014
-
09
-
20
08
:
08
:
54
,
179
ERROR org.apache.hadoop.hdfs.server.namenode.FSNamesystem: FSNamesystem initialization failed.
java.io.IOException: NameNode is not formatted.
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:
331
)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:
104
)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:
427
)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:
395
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:
299
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:
569
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:
1479
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:
1488
)
2014
-
09
-
20
08
:
08
:
54
,
199
ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: java.io.IOException: NameNode is not formatted.
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:
331
)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:
104
)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:
427
)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:
395
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:
299
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:
569
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:
1479
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:
1488
)
|
解决方法:
格式化NameNode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
[root@hadoop bin]
# ./hadoop namenode -format
13
/06/28
22:50:23 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = java.net.UnknownHostException: hadoop: hadoop
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
************************************************************/
13
/06/28
22:50:23 INFO namenode.FSNamesystem: fsOwner=root,root
13
/06/28
22:50:23 INFO namenode.FSNamesystem: supergroup=supergroup
13
/06/28
22:50:23 INFO namenode.FSNamesystem: isPermissionEnabled=
true
13
/06/28
22:50:38 INFO metrics.MetricsUtil: Unable to obtain hostName
java.net.UnknownHostException: hadoop: hadoop
at java.net.InetAddress.getLocalHost(InetAddress.java:1354)
at org.apache.hadoop.metrics.MetricsUtil.getHostName(MetricsUtil.java:91)
at org.apache.hadoop.metrics.MetricsUtil.createRecord(MetricsUtil.java:80)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.initialize(FSDirectory.java:73)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.<init>(FSDirectory.java:68)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:379)
at org.apache.hadoop.hdfs.server.namenode.NameNode.
format
(NameNode.java:854)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)
13
/06/28
22:50:38 INFO common.Storage: Image
file
of size 94 saved
in
0 seconds.
13
/06/28
22:50:38 INFO common.Storage: Storage directory
/tmp/hadoop-root/dfs/name
has been successfully formatted.
13
/06/28
22:50:38 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at java.net.UnknownHostException: hadoop: hadoop
************************************************************/
|
问题:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
2014
-
09
-
20
08
:
02
:
32
,
476
INFO org.apache.hadoop.hdfs.server.common.Storage: Storage directory /tmp/hadoop-root/dfs/name does not exist
2014
-
09
-
20
08
:
02
:
32
,
480
ERROR org.apache.hadoop.hdfs.server.namenode.FSNamesystem: FSNamesystem initialization failed.
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /tmp/hadoop-root/dfs/name is in an inconsistent state: storage directory does not exist or is not accessible.
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:
304
)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:
104
)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:
427
)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:
395
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:
299
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:
569
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:
1479
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:
1488
)
2014
-
09
-
20
08
:
02
:
32
,
494
ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /tmp/hadoop-root/dfs/name is in an inconsistent state: storage directory does not exist or is not accessible.
at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:
304
)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.loadFSImage(FSDirectory.java:
104
)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.initialize(FSNamesystem.java:
427
)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:
395
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:
299
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:
569
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:
1479
)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:
1488
)
2014
-
09
-
20
08
:
02
:
32
,
495
INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
************************************************************/
|
解决:
1
|
mkidr -pv
/tmp/hadoop-root/dfs/name
|
本文转自 梦朝思夕 51CTO博客,原文链接:http://blog.51cto.com/qiangmzsx/1556336