共计 2231 个字符,预计需要花费 6 分钟才能阅读完成。
Hadoop 企业级集群架构 – DNS 安装
1. 配置 IP
vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
systemctl restart network.service
ip -4 addr
ping 192.168.1.1
vi /etc/hostname
ddd the following line:
dns.hadoop.com
安装 DNS 软件包
yum -y install bind bind-utils bind-chroot
rpm -qa | grep ‘^bind’
修改 /etc/named.conf
listen-on port 53 {any;}; #将原来的 127.0.0.1 改为 any
allow-query {any;}; #将原来的 localhost 改为 any
修改 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;};
};
配置正向解析文件
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
配置反向解析文件
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.
查看日志
tail -30 /var/log/messages | grep named
添加 DNS 解析服务器 IP
(其各节点的机器的 IP 配置文件中加入 DNS1=192.168.1.230)
启动 DNS
# 启动 DNS
systemctl start named.service
# 设置自启动
systemctl start named.service
# 查看 DNS 状态
systemctl status named.service
验证测试:
下面关于 Hadoop 的文章您也可能喜欢,不妨看看:
Ubuntu14.04 下 Hadoop2.4.1 单机 / 伪分布式安装配置教程 http://www.linuxidc.com/Linux/2015-02/113487.htm
CentOS 安装和配置 Hadoop2.2.0 http://www.linuxidc.com/Linux/2014-01/94685.htm
Ubuntu 13.04 上搭建 Hadoop 环境 http://www.linuxidc.com/Linux/2013-06/86106.htm
Ubuntu 12.10 +Hadoop 1.2.1 版本集群配置 http://www.linuxidc.com/Linux/2013-09/90600.htm
Ubuntu 上搭建 Hadoop 环境(单机模式 + 伪分布模式)http://www.linuxidc.com/Linux/2013-01/77681.htm
Ubuntu 下 Hadoop 环境的配置 http://www.linuxidc.com/Linux/2012-11/74539.htm
单机版搭建 Hadoop 环境图文教程详解 http://www.linuxidc.com/Linux/2012-02/53927.htm
更多 Hadoop 相关信息见Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-11/125226.htm