主机名 |
角色 |
IP |
部署服务 |
|
hdss7-11.host.com |
k8s前端代理节点1 |
192.168.12.11 |
bind9 nginx(四层代理)keepalived supervisior |
|
hdss7-21.host.com |
k8s前端代理节点2 |
192.168.12.12 |
etcd nginx(四层代理)keepalived supervisor |
|
hdss7-21.host.com |
k8s运算节点1 |
192.168.12.21 |
etcd kube-api kube-conytroller-manager kube-scheduler kube-kubelet kube-proxy supervisior |
|
hdss7-22.host.com |
k8s运算节点2 |
192.168.12.22 |
etcd kube-api kube-conytroller-manager kube-scheduler kube-kubelet kube-proxy supervisior |
|
hdss7-200.host.com |
运维管理主机() |
192.168.12.200 |
证书服务 docker仓库(harbor) nginx代理本机harbor pause ansible |
|
1.开始安装11主机bind 9
安装必要软件
#yum -y install wget net-tools telnet tree nmap sysstat lrzsz dos2unix bind-utils -y
[root@hdss7-11 ~]# yum install -y bind
配置bind
[root@hdss7-11 ~]# vi /etc/named.conf # BIND进程的工作属性,区域的定义
13 listen-on port 53 { 192.168.154.11; }; # 监听本机IP
14 listen-on-v6 port 53 { ::1; }; # 删除,不监听IPV6
20 allow-query { any; }; # 允许所有主机查看
21 forwarders { 192.168.154.2; }; # 办公网上一级的DNS,(生产写运营商dns)
33 recursion yes; # dns采用递归的查询
35 dnssec-enable no; # 关闭,节省资源(生产可能不需要关闭)
36 dnssec-validation no; # 关闭,节省资源,不做互联网认证
检查配置
[root@hdss7-11 ~]# named-checkconf
[root@hdss7-11 ~]# echo $?
配置区域配置文件在文件末尾添加
[root@hdss7-11 ~]# vim /etc/named.rfc1912.zones
zone "host.com" IN {
type master;
file "host.com.zone";
allow-update { 192.168.12.11; };
};
zone "od.com" IN {
type master;
file "od.com.zone";
allow-update { 192.168.12.11; };
};
配置区域数据文件
[root@hdss7-11 ~]# vi /var/named/host.com.zone
[root@hdss7-11 ~]# cat /var/named/host.com.zone
$ORIGIN host.com.
$TTL 600 ; 10 minutes
@ IN SOA dns.host.com. dnsadmin.host.com. (
20200606 ; serial
10800 ; refresh (3 hours)
900 ; retry (15 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS dns.host.com.
$TTL 60 ; 1 minute
dns A 192.168.12.11
HDSS7-11 A 192.168.12.11
HDSS7-12 A 192.168.12.12
HDSS7-21 A 192.168.12.21
HDSS7-22 A 192.168.12.22
HDSS7-200 A 192.168.12.200
[root@hdss7-11 ~]# cat /var/named/od.com.zone
$ORIGIN od.com.
$TTL 600 ; 10 minutes
@ IN SOA dns.od.com. dnsadmin.od.com. (
20200606 ; serial
10800 ; refresh (3 hours)
900 ; retry (15 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS dns.od.com.
$TTL 60 ; 1 minute
dns A 192.168.12.11
检测区域数据文件
[root@hdss7-11 ~]# named-checkconf
[root@hdss7-11 ~]# named-checkzone "host.com" /var/named/host.com.zone
zone host.com/IN: loaded serial 20200606
OK
[root@hdss7-11 ~]# named-checkzone "od.com" /var/named/od.com.zone
zone od.com/IN: loaded serial 20200606
OK