Hadoopha之JournalStorageDirectorynorformatted

编程

    情况是这样的,Hadoop ha下,集群QJM的数据丢了,之后启动namenode后报Journal Storage Directory nor formatted,导致namenode启动失败,如下List-1所示:

    List-1

Journal Storage Directory /root/hdfs/journal/mycluster not formatted

at org.apache.hadoop.hdfs.qjournal.server.Journal.checkFormatted(Journal.java:479)

at org.apache.hadoop.hdfs.qjournal.server.Journal.getEditLogManifest(Journal.java:662)

at org.apache.hadoop.hdfs.qjournal.server.JournalNodeRpcServer.getEditLogManifest(JournalNodeRpcServer.java:190)

at org.apache.hadoop.hdfs.qjournal.protocolPB.QJournalProtocolServerSideTranslatorPB.getEditLogManifest(QJournalProtocolServerSideTrans

latorPB.java:224)

at org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos$QJournalProtocolService$2.callBlockingMethod(QJournalProtocolProtos.

java:25431)

at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:447)

at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:989)

at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:847)

at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:790)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:422)

    原因知道了,怎么解决呢,重新format namenode是不行的,这样集群数据都丢了。关停namenode,执行下List-2中的内容即可,hadoop会自动将namenode中的edits文件全部同步到QJM中.

    List-2

hdfs namenode -initializeSharedEdits 

 

以上是 Hadoopha之JournalStorageDirectorynorformatted 的全部内容, 来源链接: utcz.com/z/512481.html

回到顶部