每次format HDFS的时候,Namenode都会生成新的namespaceID。可以认为是current version和previous version。每次出现namespaceID不一致的时候,都可以将每一个实例rollback到previous version。
NamespaceID连接着namenode和datanode以及journalnode。Datanode和Journalnode通过namespaceID将自己绑定到namenode。
2014-04-15 15:00:02,235 FATAL org.apache.hadoop.hdfs.server.namenode.FSEditLog: Error: recoverUnfinalizedSegments failed for required journal (JournalAndStream(mgr=QJM to [172.16.19.21:8485, 172.16.19.22:8485, 172.16.19.23:8485], stream=null)) org.apache.hadoop.hdfs.qjournal.client.QuorumException: Got too many exceptions to achieve quorum size 2/3. 3 exceptions thrown: 172.16.19.22:8485: Incompatible namespaceID for journal Storage Directory /home/hkx/journaldata/ns2: NameNode has nsId 480343035 but storage has nsId 2072447892 at org.apache.hadoop.hdfs.qjournal.server.JNStorage.checkConsistentNamespace(JNStorage.java:202) at org.apache.hadoop.hdfs.qjournal.server.Journal.newEpoch(Journal.java:286) at org.apache.hadoop.hdfs.qjournal.server.JournalNodeRpcServer.newEpoch(JournalNodeRpcServer.java:132) at org.apache.hadoop.hdfs.qjournal.protocolPB.QJournalProtocolServerSideTranslatorPB.newEpoch(QJournalProtocolServerSideTranslatorPB.java:114) at org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos$QJournalProtocolService$2.callBlockingMethod(QJournalProtocolProtos.java:17439) at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585) at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2048) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2044) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491) at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2042)
每次format HDFS的时候,Namenode都会生成新的namespaceID。可以认为是current version和previous version。每次出现namespaceID不一致的时候,都可以将每一个实例rollback到previous version。
NamespaceID连接着namenode和datanode以及journalnode。Datanode和Journalnode通过namespaceID将自己绑定到namenode。