Cannot lock storage /opt/data/hadoop/hdfs/name. The directory is already locked.
2012-05-20 22:13:05| 分类: Hadoop | 标签: |字号大中小 订阅
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解决问题