设备:

master:192.168.200.125

slave:192.168.200.124

slave:192.168.200.111

Master操作:

关闭防火墙:

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

安装ntp时间同步软件:主要为了让主服务器和从服务器之间时间一致。那么从服务器中继日志和主的二进制日志数据一致

[root@localhost ~]# yum install ntp -y

[root@localhost ~]# vim /etc/ntp.conf 

在末尾加入如下两行:主要让自己变成ntp的服务端使得从服务器能获取主服务器的时间

server 127.127.1.0 fudge 127.127.1.0 stratum 8

启动NTP服务:

[root@localhost ~]# systemctl start ntpd
[root@localhost ~]# systemctl enable ntpd

Slave操作:两台从操作一致

关闭防火墙:

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

安装ntpdate:

[root@localhost ~]# yum install ntpdate -y

02-01 16:41
查看更多