Hadoop의 NameNode에서 이상을 시작할 수 없습니다.

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.(FSNamesystem.java:395)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:299)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.(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.(FSNamesystem.java:395)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:299)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.(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 포맷
[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.(FSDirectory.java:68)
	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.(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
************************************************************/

질문:
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.(FSNamesystem.java:395)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:299)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.(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.(FSNamesystem.java:395)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:299)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.(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
************************************************************/

해결:
mkidr -pv  /tmp/hadoop-root/dfs/name

좋은 웹페이지 즐겨찾기