다중 홈 네트워크에서의 HDFS 지원
다중 홈 네트워크에서의 HDFS 지원 (Multihomed Networks)
여러 네트워크 인터페이스에 연결된(멀티호밍) 환경에서 HDFS를 운영하는 관리자를 위한 문서예요. 데몬이 모든 인터페이스에 바인딩하도록 하는 설정, 클라이언트와 DataNode의 호스트명 사용, 보안(kerberos) 환경에서의 호스트명 조회 문제를 다룹니다. YARN/MapReduce에 대한 유사한 지원은 진행 중이며, 준비되면 문서화될 예정입니다.
출처: 문서
본문
멀티호밍 배경 (Multihoming Background)
멀티호밍 네트워크에서는 클러스터 노드가 하나 이상의 네트워크 인터페이스에 연결됩니다. 그렇게 하는 이유는 여러 가지일 수 있어요.
- 보안 (Security) — 보안 요구사항에 따라 클러스터 내부 트래픽을 클러스터로 들어오고 나가는 데이터 전송 네트워크와 다른 네트워크로 국한해야 할 수 있음.
- 성능 (Performance) — 클러스터 내부 트래픽이 Fiber Channel, Infiniband, 10GbE 같은 하나 이상의 고대역폭 상호연결을 사용할 수 있음.
- 장애 조치/이중화 (Failover/Redundancy) — 노드가 네트워크 어댑터 고장에 대응하도록 단일 네트워크에 연결된 여러 네트워크 어댑터를 가질 수 있음.
참고: NIC 본딩(NIC Bonding, NIC Teaming 또는 Link Aggregation)은 관련 있지만 별개의 주제입니다. 본딩 구성은 애플리케이션에 단일 '논리 네트워크'를 제공하면서 다중화·장애 조치를 투명하게 처리하므로, 아래 설정은 보통 본딩 구성에는 적용되지 않아요.
멀티호밍 환경에서 Hadoop 문제 해결하기
HDFS 데몬이 모든 인터페이스에 바인딩하도록 보장하기
기본적으로 HDFS 엔드포인트는 호스트명 또는 IP 주소로 지정됩니다. 어느 쪽이든 HDFS 데몬은 단일 IP 주소에 바인딩되어 다른 네트워크에서 접근할 수 없게 됩니다.
해결책은 서버 엔드포인트에 별도 설정을 두어 와일드카드 IP 주소 INADDR_ANY, 즉 0.0.0.0에 바인딩하도록 강제하는 것입니다. 이 설정값에는 포트 번호를 넣지 마세요.
참고: 마스터/슬레이브 설정 파일에서는 IP 주소보다 호스트명을 사용하는 것이 좋아요.
<property>
<name>dfs.namenode.rpc-bind-host</name>
<value>0.0.0.0</value>
<description>
The actual address the RPC server will bind to. If this optional address is
set, it overrides only the hostname portion of dfs.namenode.rpc-address.
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.
</description>
</property>
<property>
<name>dfs.namenode.servicerpc-bind-host</name>
<value>0.0.0.0</value>
<description>
The actual address the service RPC server will bind to. If this optional address is
set, it overrides only the hostname portion of dfs.namenode.servicerpc-address.
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.
</description>
</property>
<property>
<name>dfs.namenode.http-bind-host</name>
<value>0.0.0.0</value>
<description>
The actual address the HTTP server will bind to. If this optional address
is set, it overrides only the hostname portion of dfs.namenode.http-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.
</description>
</property>
<property>
<name>dfs.namenode.https-bind-host</name>
<value>0.0.0.0</value>
<description>
The actual address the HTTPS server will bind to. If this optional address
is set, it overrides only the hostname portion of dfs.namenode.https-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.
</description>
</property>
클라이언트가 DataNode에 연결할 때 호스트명 사용하기
기본적으로 HDFS 클라이언트는 NameNode가 제공한 IP 주소로 DataNode에 연결합니다. 네트워크 구성에 따라 이 IP 주소가 클라이언트에서 연결할 수 없을 수도 있어요. 해결책은 클라이언트가 DataNode 호스트명을 스스로 DNS 해석하도록 하는 것입니다. 다음 설정이 이 동작을 활성화합니다.
<property>
<name>dfs.client.use.datanode.hostname</name>
<value>true</value>
<description>Whether clients should use datanode hostnames when
connecting to datanodes.
</description>
</property>
DataNode가 다른 DataNode에 연결할 때 호스트명 사용하기
드물게, NameNode가 해석한 DataNode의 IP 주소가 다른 DataNode에서 연결할 수 없을 수 있습니다. 해결책은 DataNode 간 연결을 위해 DataNode가 스스로 DNS 해석을 수행하도록 강제하는 것입니다. 다음 설정이 이 동작을 활성화합니다.
<property>
<name>dfs.datanode.use.datanode.hostname</name>
<value>true</value>
<description>Whether datanodes should use datanode hostnames when
connecting to other datanodes for data transfer.
</description>
</property>
멀티호밍과 Hadoop 보안 (Multihoming and Hadoop Security)
멀티호밍 호스트를 Secure Mode의 Hadoop으로 구성하려면 추가 설정이 필요할 수 있습니다.
호스트명 조회 (Hostname Lookup)
Hadoop 서비스의 Kerberos 프린시펄은 ServiceName/[email protected] 패턴으로 지정합니다. 예: nn/[email protected]. 이렇게 하면 모든 호스트에서 같은 설정 파일을 사용할 수 있어요. 서비스는 런타임에 조회한 자기 호스트명으로 프린시펄의 _HOST를 치환합니다.
노드가 DNS나 /etc/hosts 파일에 여러 호스트명을 갖도록 설정된 경우, 서비스가 서버가 기대하는 것과 다른 호스트명을 조회할 수 있습니다. 예를 들어 두 서비스 간 클러스터 내부 트래픽이 개인 인터페이스로 라우팅되는데 클라이언트 서비스가 자신의 공개 호스트명을 조회했다면, 프린시펄의 호스트명이 트래픽이 도착한 IP 주소와 일치하지 않아 Kerberos 인증이 실패합니다.
다음 설정(Apache Hadoop 2.8.0부터 사용 가능)으로 서비스가 조회하는 호스트명을 제어할 수 있어요.
<property>
<name>hadoop.security.dns.interface</name>
<description>
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.
</description>
</property>
서비스가 호스트명 조회에 특정 DNS 서버를 사용하도록 구성할 수도 있습니다(거의 필요하지 않음).
<property>
<name>hadoop.security.dns.nameserver</name>
<description>
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
hadoop.security.dns.interface.
Most clusters will not require this setting.
</description>
</property>
더 알아보기 (Learn more)
- 원문: 문서