1、安装 ntp 服务
shell> yum -y install ntp
2、修改启动参数,允许ntp服务在系统时间误差较大时也能正常工作
shell> vi /etc/sysconfig/ntpd
# 增加 -x 参数
OPTIONS="-g -x"
3、启动 ntp 服务
shell> systemctl start ntpd
4、将 ntp 服务设为自启动
shell> systemctl enable ntpd
5、将系统时区改为上海时间 (亦即CST时区)
shell> ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
查看系统时间
shell> date
2016年 11月 18日 星期五 18:14:17 CST