Centos网络时间同步

场景

系统为Centos6或7, 多个服务器之间存在时间合法性验证,由于各服务器时间不统一,验证不通过。

解决方法

执行如下命令矫正本地时间,网络同步

1
2
3
4
5
6
7
8
# 安装网络时间协议
yum install ntp
# 开启ntp daemon,开机自启动
chkconfig ntpd on
# 同步系统时间,可选任意可靠的时间服务器,这里用的是pool.ntp.org
ntpdate pool.ntp.org
# 启动时间同步协议
service ntpd start