LVS
nat服务器(作时间服务器)
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum -y install ntpdate
[root@localhost ~]# ntpdate cn.ntp.org.cn
[root@localhost ~]# which ntpdate
[root@localhost ~]# crontab -e
* 2 * * * /usr/sbin/ntpdate cn.ntp.org.cn
[root@localhost ~]# yum -y install ntp
[root@localhost ~]# systemctl start ntpd
[root@localhost ~]# systemctl enable ntpd
配置规则
[root@localhost ~]# yum -y install ipvsadm
[root@localhost ~]# ipvsadm -A -t 192.168.1.43:80 -s rr
[root@localhost ~]# ipvsadm -A -t 192.168.1.42:80 -s rr
[root@localhost ~]# ipvsadm -a -t 192.168.1.42:80 -r 192.168.1.40:80 -m
[root@localhost ~]# ipvsadm -a -t 192.168.1.42:80 -r 192.168.1.41:80 -m
dns服务器
[root@localhost ~]# yum -y install bind
[root@localhost ~]# vim /etc/named.conf
listen-on port 53 { 127.0.0.1;any; };
allow-query { localhost;any; };
[root@localhost ~]# vim /etc/named.rfc1912.zones
zone "yu.feng" IN {
type master;
file "yu.feng.zone";
allow-update { none; };
};
[root@localhost ~]# cp -p /var/named/named.localhost /var/named/yu.feng.zone
[root@localhost ~]# vim /var/named/yu.feng.zone
nat A 192.168.1.42
ds A 192.168.1.43
web A 192.168.1.40
web2 A 192.168.1.41
[root@localhost ~]# systemctl start named
[root@localhost ~]# yum -y install ntpdate
[root@localhost ~]# crontab -e
30 2 * * * /usr/sbin/ntpdate 192.168.1.42
[root@localhost ~]# ntpdate cn.ntp.org.cn
web服务器
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum -y install nginx
[root@localhost ~]# nginx
[root@localhost ~]# yum -y install ntpdate
[root@localhost ~]# crontab -e
30 2 * * * /usr/sbin/ntpdate 192.168.1.42
[root@localhost ~]# ntpdate cn.ntp.org.cn