Hadoop format的时候The directory is already locked

Cannot lock storage /opt/data/hadoop/hdfs/name. The directory is already locked.  

2012-05-20 22:13:05|  分类: Hadoop |  标签: |字号 订阅

[root@nn01 bin]# ./hadoop namenode -format

13/10/20 02:06:12 WARN common.Util: Path /opt/data/hadoop/hdfs/name should be specified as a URI in configuration files. Please update hdfs configuration.
Re-format filesystem in /opt/data/hadoop/hdfs/name ? (Y or N) Y
13/10/20 02:06:13 INFO namenode.FSNamesystem: defaultReplication = 3
13/10/20 02:06:13 INFO namenode.FSNamesystem: maxReplication = 512
13/10/20 02:06:13 INFO namenode.FSNamesystem: minReplication = 1
13/10/20 02:06:13 INFO namenode.FSNamesystem: maxReplicationStreams = 2
13/10/20 02:06:13 INFO namenode.FSNamesystem: shouldCheckForEnoughRacks = false
13/10/20 02:06:13 INFO security.Groups: Group mapping impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping; cacheTimeout=300000
13/10/20 02:06:13 INFO namenode.FSNamesystem: fsOwner=hadoop
13/10/20 02:06:13 INFO namenode.FSNamesystem: supergroup=supergroup
13/10/20 02:06:13 INFO namenode.FSNamesystem: isPermissionEnabled=false
13/10/20 02:06:13 INFO namenode.FSNamesystem: isAccessTokenEnabled=false accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)
13/10/20 02:06:14 INFO common.Storage: Cannot lock storage /opt/data/hadoop/hdfs/name. The directory is already locked.
13/10/20 02:06:14 ERROR namenode.NameNode: java.io.IOException: Cannot lock storage /opt/data/hadoop/hdfs/name. The directory is already locked.
        at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.lock(Storage.java:617)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1426)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1444)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1242)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1348)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1368)

13/10/20 02:06:14 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at master/10.3.19.199

  

./hadoop namenode -format 命令是格式化命名空间,一定是在未启动  hadoop 服务的时候才能执行。出现这个错误提示是因为 hadoop 的服务是子运行状态。

是因为没有关闭hadoop就开始format,sh stop-all.sh 后再format解决问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值