yum -y install ntp
# ceph-k8s-01 $ vi /etc/ntp.conf driftfile /var/lib/ntp/drift restrict default nomodify notrap nopeer noquery restrict 127.0.0.1 restrict ::1 restrict 172.20.5.0 mask 255.255.255.0 nomodify notrap # 添加可以同步时间的网段 server 127.127.1.0 # 外部时间服务器不可用时, 以本地时间作为时间服务 Fudge 127.127.1.0 stratum 10 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys disable monitor # ceph-k8s-02和ceph-k8s-03,同步ceph-k8s-01 $ vi /etc/ntp.conf server 172.20.5.25 iburst minpoll 4 maxpoll 10
systemctl start ntpd
systemctl enable ntpd