【故障背景】
DataNode进程正常启动,但是网页上不显示,并且DataNode节点为空。
/etc/hosts 的ip和hostname配置正常,各个机器之间能够ping通。
【日志错误信息】
2018-06-11 17:29:08,165 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Block pool BP-591370997-192.168.243.12-1528711881217 (Datanode Uuid null) service to bigdata12/192.168.243.12:9000 beginning handshake with NN
2018-06-11 17:29:08,434 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool BP-591370997-192.168.243.12-1528711881217 (Datanode Uuid null) service to bigdata12/192.168.243.12:9000 Datanode denied communication with namenode because hostname cannot be resolved (ip=192.168.243.131, hostname=192.168.243.131): DatanodeRegistration(0.0.0.0:50010, datanodeUuid=0ed267a7-573d-4be0-b1f5-15483cd83b18, infoPort=50075, infoSecurePort=0, ipcPort=50020, storageInfo=lv=-56;cid=CID-d21c2227-4e04-4bc9-ae97-689edef3d580;nsid=1745335624;c=0)
at org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager.registerDatanode(DatanodeManager.java:873)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.registerDatanode(FSNamesystem.java:4529)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.registerDatanode(NameNodeRpcServer.java:1286)
at org.apache.hadoop.hdfs.protocolPB.DatanodeProtocolServerSideTranslatorPB.registerDatanode(DatanodeProtocolServerSideTranslatorPB.java:96)
at org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos$DatanodeProtocolService$2.callBlockingMethod(DatanodeProtocolProtos.java:28752)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:982)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2049)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2045)
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:1698)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2043)
【解决办法】
在hdfs-site.xml中添加以下属性
<property> <name>dfs.namenode.datanode.registration.ip-hostname-check</name> <value>false</value> </property>
重启hadoop集群后成功
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/9142.html