hadoop 不使用hostname,使用ip遇到的问题(Datanode denied communication with namenode because hostname cann)及解决方案

本文详细解释了如何使用hosts.deny和hosts.allow文件来限制对Hadoop集群的访问,以及如何通过修改配置避免DNS解析问题,并介绍了如何通过配置避免数据节点注册检查以适应特定环境如AWS VPC。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

“Hadoop provides a mechanism to prevent unauthorized access. User can add hosts.deny and hosts.allow files to limit the access to a hadoop cluster. When a data node joins the name node, the name node will check the DNS name of the data node, if the DNS name cannot be resolved or the host is not allowed based on hosts.deny and hosts.allow files, the NN will reject the data node join.

org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.protocol.DisallowedDatanodeException): Datanode denied communication with namenode because hostname cannot be resolved (ip=10.5.x.x, hostname=10.5.x.x): DatanodeRegistration(0.0.0.0, datanodeUuie12e2d92-e215-4af9-a09b-d22ef4e3cc5ainfoPort=9102, ipcPort=9201, storageInfo=lv=-55;cid=CID-f50d3808-5d7f-4520-b696-0234f07f89f7;nsid=1758720717;c=0)

If set dfs.namenode.datanode.registration.ip-hostname-check=false, the name node will not do the check, which could be useful if your cluster is inside AWS VPC and you do not have proper reverse DNS.

Another usage of this feature is to decommission a data node by listing it in the hosts.deny file.”

也就是说在namenode的hdfs-site.xml 里面添加

<property>
                      <name>dfs.namenode.datanode.registration.ip-hostname-check</name>
                      <value>false</value>
                  </property>

即可


评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值