首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

HDFS对多宿主网络的支持

Apache Hadoop 2.9.0

请查看原文:http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsMultihoming.html

(如果转发,请标明出处)

本文档面向部署HDFS到多宿主网络的集群管理员。对YARN/MapReduce的类似支持正在进行中,并将在可用后记录成文档。

多宿主网络背景

在多宿主网络中,集群节点将会链接多个网络接口,这是有多个原因导致的。

① 安全(Security) : 安全要求可以规定集群内流量被限制在不同于数据传入和传出集群的网络。(也就是为了安全性,将内部数据传输,集群数据传入传出限定在不同的网络-- by程序猿码码)。

② 性能(Performance):集群内业务可以使用一个或者多个高带宽互连,例如Fiber Channel, Infiniband或者10GbE。

③ 故障恢复/冗余(Failover/Redundancy):节点可以拥有连接到单个网络的多个网络适配器以处理网络适配器故障。

需要注意的是,NIC绑定(也称为NIC Teaming或链路聚合)是一个相关但独立的主题。以下设置通常不适用于在向应用程序呈现单个“逻辑网络”时透明地处理多路复用和故障切换的NIC绑定配置。

修复多宿主环境中的Hadoop问题

确认HDFS 守护程序(daemons)绑定所有接口(Interfaces)

默认情况下,HDFS端点(endpoints)指定为主机名或IP地址。无论是哪种情况,HDFS守护程序(daemons)都将绑定到单个IP地址,从而使守护程序无法从其他网络访问。

解决方案是为服务器端点(server endpoints)设置单独的设置,以强制绑定INADDR_ANYi.e.0.0.0.0中的通配符IP地址。不要提供任何端口号的设置。

需要注意的是,在master/slave的配置文件中,使用主机名来代替IP地址。

0.0.0.0

The actual address the RPC server will bind to. If this optional address is

It can also be specified per name node or name service for HA/Federation.

This is useful for making the name node listen on all interfaces by

setting it to 0.0.0.0.

0.0.0.0

The actual address the service RPC server will bind to. If this optional address is

It can also be specified per name node or name service for HA/Federation.

This is useful for making the name node listen on all interfaces by

setting it to 0.0.0.0.

0.0.0.0

The actual adress the HTTP server will bind to. If this optional address

It can also be specified per name node or name service for HA/Federation.

This is useful for making the name node HTTP server listen on all

interfaces by setting it to 0.0.0.0.

0.0.0.0

The actual adress the HTTPS server will bind to. If this optional address

It can also be specified per name node or name service for HA/Federation.

This is useful for making the name node HTTPS server listen on all

interfaces by setting it to 0.0.0.0.

客户端连接到DataNodes时使用Hostnames

默认情况下,HDFS客户端使用NameNode提供的IP地址来连接到DataNodes。根据网络配置,客户端可能无法访问此IP地址。修复的办法是让客户端对DataNode主机名执行自己的DNS解析。下面的设置可以做到以上描述的:

true

Whether clients should use datanode hostnames when

connecting to datanodes.

DataNodes连接到其它DataNodes时使用主机名

一个DataNode可能无法得到其它DataNodes的IP地址(NameNode解析的IP地址)。修复方法是强制DataNode为DataNode间连接执行自己的DNS解析。以下设置启用此行为。

true

Whether datanodes should use datanode hostnames when

connecting to other datanodes for data transfer.

多宿主和Hadoop安全

在Hadoop Secure模式下配置多宿主主机需要增加额外的配置。

主机名查找(Hostname Lookup)

当所有的节点都在DNS或者/etc/hosts文件中配置有多个主机名时,服务可能会查找到与服务器预期不同的服务名。例如,两个服务之间的集群内流量可以通过专用接口路由,但客户端服务会查找其公共主机名。Kerberos身份验证将失败,因为主体中的主机名与流量到达的IP地址不匹配。

以下设置(从Apache Hadoop 2 . 8 . 0开始可用)可用于控制查找服务的主机名。

The name of the Network Interface from which the service should determine

its host name for Kerberos login. e.g. eth2. In a multi-homed environment,

the setting can be used to affect the _HOST subsitution in the service

Kerberos principal. If this configuration value is not set, the service

will use its default hostname as returned by

InetAddress.getLocalHost().getCanonicalHostName().

Most clusters will not require this setting.

服务还可以配置为使用特定的DNS服务器进行主机名查找(很少需要)。

The host name or IP address of the name server (DNS) which a service Node

should use to determine its own host name for Kerberos Login. Requires

Most clusters will not require this setting.

-----------全文完------------------

备注:

多宿主:Multihoming

网络适配器:network adapter

集群内部业务:Intra-cluster traffic

NIC绑定:NIC Bonding

NIC绑定:NIC Teaming

链路聚合:Link Aggregation

  • 发表于:
  • 原文链接http://kuaibao.qq.com/s/20180512G0BWJ500?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券