[user6@das0 hadoop-0.20.203.0]$ bin/hadoop namenode -format
12/02/20 14:05:17 INFO namenode.NameNode: STARTUP_MSG:
Re-format filesystem in /data0/hadoop-name ? (Y or N) y
Format aborted in /data0/hadoop-name
12/02/20 14:05:20 INFO namenode.NameNode: SHUTDOWN_MSG:
随后启动hadoop, 发现无法显示。
将/data0/hadoop-name文件夹整个删除。然后再格,成功!!!
[zhangpeng6@das0 hadoop-0.20.203.0]$ bin/hadoop namenode -format
12/02/20 14:09:57 INFO namenode.NameNode: STARTUP_MSG:
12/02/20 14:09:57 INFO util.GSet: VM type =
64-bit
12/02/20 14:09:57 INFO util.GSet: 2% max memory = 177.77875 MB
12/02/20 14:09:57 INFO util.GSet: capacity = 2^24 =
16777216 entries
12/02/20 14:09:57 INFO util.GSet: recommended=16777216,
actual=16777216
12/02/20 14:09:57 INFO namenode.FSNamesystem: fsOwner=zhangpeng6
12/02/20 14:09:57 INFO namenode.FSNamesystem: supergroup=supergroup
12/02/20 14:09:57 INFO namenode.FSNamesystem:
isPermissionEnabled=true
12/02/20 14:09:57 INFO namenode.FSNamesystem:
dfs.block.invalidate.limit=100
12/02/20 14:09:57 INFO namenode.FSNamesystem: isAccessTokenEnabled=false
accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)
12/02/20 14:09:57 INFO namenode.NameNode: Caching file names occuring more
than 10 times
12/02/20 14:09:57 INFO common.Storage: Image file of size 116 saved in 0
seconds.
12/02/20 14:09:57 INFO common.Storage: Storage directory
/data0/hadoop-name/namenode has been successfully formatted.
12/02/20 14:09:57 INFO namenode.NameNode: SHUTDOWN_MSG:
问题总结:
在对namenode格式化之前,要确保dfs.name.dir参数指定的目录不存在。
Hadoop这样做的目的是防止错误地将已存在的集群格式化了