Hadoop企业级集群架构 - DNS安装

Hadoop企业级集群架构 - DNS安装

1. 配置IP  

vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

systemctl restart network.service  

Hadoop企业级集群架构 - DNS安装

ip -4 addr

ping 192.168.1.1

Hadoop企业级集群架构 - DNS安装

vi /etc/hostname

ddd the following line:

dns.hadoop.com  

Hadoop企业级集群架构 - DNS安装 

安装DNS软件包  

yum -y install bind bind-utils bind-chroot  

Hadoop企业级集群架构 - DNS安装

rpm -qa | grep '^bind'  

Hadoop企业级集群架构 - DNS安装 

修改/etc/named.conf

listen-on port 53 { any; }; #将原来的127.0.0.1改为any

allow-query { any; }; #将原来的localhost改为any  

Hadoop企业级集群架构 - DNS安装

修改named.rfc1912.zones

添加入下内容:(也可以直接写在/etc/named.conf中)  

zone "hadoop.com" IN {

type master;

file "named.hadoop.com";

allow-update { none; };

};

 

zone '1.168.192.in-addr.arpa" IN {

type master;

file "named.192.168.1.zone";

allow-update { none; };

};

 

Hadoop企业级集群架构 - DNS安装

配置正向解析文件

cp named.localhost named.hadoop.com

然后向文件named.hadoop.com添加如下内容

$TTL 1D

@ IN SOA dns.hadoop.com. grid.dns.hadoop.com. (

0 ; serial

1D ; refresh

1H ; retry

1W ; expire

3H ) ; minimum

NS dns.hadoop.com.

dns.hadoop.com. IN A 192.168.1.230

h1.hadoop.com. IN A 192.168.1.231

h2.hadoop.com. IN A 192.168.1.232

h3.hadoop.com. IN A 192.168.1.233

h4.hadoop.com. IN A 192.168.1.234

h5.hadoop.com. IN A 192.168.1.235

h6.hadoop.com. IN A 192.168.1.236

h7.hadoop.com. IN A 192.168.1.237

h8.hadoop.com. IN A 192.168.1.238

Hadoop企业级集群架构 - DNS安装

配置反向解析文件

cp named.localhost named.192.168.1.zone

并添加如下内容:  

$TTL 1D

@ IN SOA dns.hadoop.com. grid.dns.hadoop.com (

0 ; serial

1D ; refresh

1H ; retry

1W ; expire

3H ) ; minimum

NS dns.hadoop.com.

231 IN PTR h1.hadoop.com.

232 IN PTR h2.hadoop.com.

233 IN PTR h3.hadoop.com.

234 IN PTR h4.hadoop.com.

235 IN PTR h5.hadoop.com.

236 IN PTR h6.hadoop.com.

237 IN PTR h7.hadoop.com.

238 IN PTR h8.hadoop.com.

 

Hadoop企业级集群架构 - DNS安装

查看日志

tail -30 /var/log/messages | grep named

Hadoop企业级集群架构 - DNS安装

添加DNS解析服务器IP

(其各节点的机器的IP配置文件中加入DNS1=192.168.1.230)

Hadoop企业级集群架构 - DNS安装

启动DNS  

#启动DNS

systemctl start named.service

#设置自启动

systemctl start named.service

#查看DNS状态

systemctl status named.service  

Hadoop企业级集群架构 - DNS安装

验证测试:  

Hadoop企业级集群架构 - DNS安装

下面关于Hadoop的文章您也可能喜欢,不妨看看:

相关推荐