1、安装ntp,yum install ntp

2、Date 发现格式为EDT,我们需要修改为CST格式

3、[root@test ~]# mv /etc/localtime /etc/localt坡纠课柩ime.bak[root@t髫潋啜缅est ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime[root@test ~]# date

4、并用ntpdate 208.91.112.50,同步网上的一台ntp服务器同步时间

5、vi/etc/ntp.conf,修改配置文件,使能同步网上的ntp服务器

6、我们烂瘀佐栾这里使用的是centos7不同于以往linux的操作,对于开机自启动的调整,命令有所不同。 chkconfig --list查看非系统内置服务的自启动状态systemctl enable ntpd.service //开机自启动

7、ntpq –p*表示目前使用的ntp server的状态

8、Ntpstat,可以看到已经同步了

9、显示所有已启动的服务 systemctl list-units --type=service
