一、准備服務器,三台服務器
192.168.207.133(server端)
192.168.207.137(client端)
192.168.207.132(client端)
二、安裝server端
2.1 yum安裝
yum install ntp ntpdate
2.2 編輯配置文件
vim /etc/ntp.conf #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst server 192.168.207.133 fudge 127.127.1.0 stratum 11
2.3. 啟動服務
systemctl start ntpd
systemctl enable ntpd.service #設置開機啟動服務
三、安裝客戶端
3.1 yum安裝
yum install ntp ntpdate
3.2 同步時間
ntpdate -d -b 192.168.207.133
3.3 編輯配置文件
和server端相同
3.4 啟動服務
systemctl start ntpd
systemctl enable ntpd.service #設置開機啟動服務