1、安装ntp
yum install -y ntp
2、配置
[root@master ~]# 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 0.asia.pool.ntp.org iburst server 1.asia.pool.ntp.org iburst server 2.asia.pool.ntp.org iburst server 3.asia.pool.ntp.org iburst
3、启动
启动ntp服务,并开机自启动 [root@master ~]# systemctl start ntpd [root@master ~]# systemctl enable ntpd
4、检查
[root@master ~]# date Tue Nov 17 21:24:24 CST 2020