Hadoop中namenode启动不起来解决方法

之前Hadoop集群都能启动成功,今天准备使用hive的时候发现Hadoop中的namenode 启动不起来的,查看日志:2020-04-14 22:25:31,793 WARN org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager: Remote journal 192.168.52.110:8485 failed to write txns 1152-1152. Will try to write to this JN again after the next log roll.
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.qjournal.protocol.JournalOutOfSyncException): IPC serial 477 from client /192.168.52.100 was not higher than prior highest IPC serial 496
at org.apache.hadoop.hdfs.qjournal.server.Journal.checkSync(Journal.java:485)
at org.apache.hadoop.hdfs.qjournal.server.Journal.checkRequest(Journal.java:439)
at org.apache.hadoop.hdfs.qjournal.server.Journal.checkWriteRequest(Journal.java:457)
at org.apache.hadoop.hdfs.qjournal.server.Journal.journal(Journal.java:352)
at org.apache.hadoop.hdfs.qjournal.server.JournalNodeRpcServer.journal(JournalNodeRpcServer.java:149)
at org.apache.hadoop.hdfs.qjournal.protocolPB.QJournalProtocolServerSideTranslatorPB.journal(QJournalProtocolServerSideTranslatorPB.java:158)
at org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos$QJournalProtocolService 2. c a l l B l o c k i n g M e t h o d ( Q J o u r n a l P r o t o c o l P r o t o s . j a v a : 25421 ) a t o r g . a p a c h e . h a d o o p . i p c . P r o t o b u f R p c E n g i n e 2.callBlockingMethod(QJournalProtocolProtos.java:25421) at org.apache.hadoop.ipc.ProtobufRpcEngine 2.callBlockingMethod(QJournalProtocolProtos.java:25421)atorg.apache.hadoop.ipc.ProtobufRpcEngineServer P r o t o B u f R p c I n v o k e r . c a l l ( P r o t o b u f R p c E n g i n e . j a v a : 617 ) a t o r g . a p a c h e . h a d o o p . i p c . R P C ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:617) at org.apache.hadoop.ipc.RPC ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:617)atorg.apache.hadoop.ipc.RPCServer.call(RPC.java:1073)
at org.apache.hadoop.ipc.Server$Handler 1. r u n ( S e r v e r . j a v a : 2216 ) a t o r g . a p a c h e . h a d o o p . i p c . S e r v e r 1.run(Server.java:2216) at org.apache.hadoop.ipc.Server 1.run(Server.java:2216)atorg.apache.hadoop.ipc.ServerHandler 1. r u n ( S e r v e r . j a v a : 2212 ) a t j a v a . s e c u r i t y . A c c e s s C o n t r o l l e r . d o P r i v i l e g e d ( N a t i v e M e t h o d ) a t j a v a x . s e c u r i t y . a u t h . S u b j e c t . d o A s ( S u b j e c t . j a v a : 422 ) a t o r g . a p a c h e . h a d o o p . s e c u r i t y . U s e r G r o u p I n f o r m a t i o n . d o A s ( U s e r G r o u p I n f o r m a t i o n . j a v a : 1796 ) a t o r g . a p a c h e . h a d o o p . i p c . S e r v e r 1.run(Server.java:2212) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1796) at org.apache.hadoop.ipc.Server 1.run(Server.java:2212)atjava.security.AccessController.doPrivileged(NativeMethod)atjavax.security.auth.Subject.doAs(Subject.java:422)atorg.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1796)atorg.apache.hadoop.ipc.ServerHandler.run(Server.java:2210)

at org.apache.hadoop.ipc.Client.call(Client.java:1472)
at org.apache.hadoop.ipc.Client.call(Client.java:1409)
at org.apache.hadoop.ipc.ProtobufRpcEngine I n v o k e r . i n v o k e ( P r o t o b u f R p c E n g i n e . j a v a : 230 ) a t c o m . s u n . p r o x y . Invoker.invoke(ProtobufRpcEngine.java:230) at com.sun.proxy. Invoker.invoke(ProtobufRpcEngine.java:230)atcom.sun.proxy.Proxy11.journal(Unknown Source)
at org.apache.hadoop.hdfs.qjournal.protocolPB.QJournalProtocolTranslatorPB.journal

百度搜索说是因为我的hdfs-site.xml配置出错,但是因为直到今天都一直可以运行所以不是这个原因。

然后又仔细看日志,发现一直在说journalnode的问题,虚拟机因为本身很不稳定,所以有些时候会出现JournalNode是用来同步NameNode的元数据的,同步的过程中发现当前同步的版本号低于系统当前的版本,也就是说他想拿已经过期的老数据修改新数据所以可能出现错误。

于是我先找到192.168.52.100(cdh01)这台机器上的Journalnode的目录
在hdfs-site.xml文件中的配置:

dfs.journalnode.edits.dir
/home/hadoop/data/journaldata/jn
Hadoop中namenode启动不起来解决方法_第1张图片最后一行显示的两个文件,都删除掉
执行:rm -rf current 和 rm -rf in_use.lock

再去查看namenode就好了。

你可能感兴趣的:(Hadoop中namenode启动不起来解决方法)