[root@localhost program]# hadoop namenode -format
09/04/24 09:38:13 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = localhost.localdomain/127.0.0.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 0.19.0
STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19 -r 713890; compiled by 'ndaley' on Fri Nov 14 03:12:29 UTC 2008
************************************************************/
Re-format filesystem in /tmp/hadoop-root/dfs/name ? (Y or N) y
Format aborted in /tmp/hadoop-root/dfs/name
09/04/24 09:38:59 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost.localdomain/127.0.0.1
************************************************************/
怎么格式化的时候会出错误?
把/tmp/hadoop-root/dfs/下 name文件夹整个删除,再进行格式化,操作成功了。。。
[root@localhost hadoop-root]# rm /tmp/hadoop-root/dfs/name/ -rf
[root@localhost hadoop-root]# rm /tmp/hadoop-root/dfs/
[root@localhost hadoop-root]# hadoop namenode -format
09/04/24 09:42:55 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = localhost.localdomain/127.0.0.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 0.19.0
STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19 -r 713890; compiled by 'ndaley' on Fri Nov 14 03:12:29 UTC 2008
************************************************************/
09/04/24 09:42:56 INFO namenode.FSNamesystem: fsOwner=root,root,bin,daemon,sys,adm,disk,wheel
09/04/24 09:42:56 INFO namenode.FSNamesystem: supergroup=supergroup
09/04/24 09:42:56 INFO namenode.FSNamesystem: isPermissionEnabled=true
09/04/24 09:42:56 INFO common.Storage: Image file of size 94 saved in 0 seconds.
09/04/24 09:42:58 INFO common.Storage: Storage directory /tmp/hadoop-root/dfs/name has been successfully formatted.
09/04/24 09:42:58 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost.localdomain/127.0.0.1
************************************************************/
之前的格式化为什么出错?只能格式化一次吗?
可以参看笔记5,如果hadoop-site.xml为空,则使用默认值?对单点进行配置后,再运行 hadoop namenode -fromat,生成文件系统的位置变化了。。。
hadoop namenode -format
09/04/27 01:04:44 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = localhost.localdomain/127.0.0.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 0.19.0
STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19 -r 713890; compiled by 'ndaley' on Fri Nov 14 03:12:29 UTC 2008
************************************************************/
09/04/27 01:04:45 INFO namenode.FSNamesystem: fsOwner=root,root,bin,daemon,sys,adm,disk,wheel
09/04/27 01:04:45 INFO namenode.FSNamesystem: supergroup=supergroup
09/04/27 01:04:45 INFO namenode.FSNamesystem: isPermissionEnabled=true
09/04/27 01:04:45 INFO common.Storage: Image file of size 94 saved in 0 seconds.
09/04/27 01:04:45 INFO common.Storage: Storage directory /home/root/hdfs/name has been successfully formatted.
09/04/27 01:04:45 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost.localdomain/127.0.0.1
************************************************************/