时间同步插件
有两种插件可以实现服务器时间同步:ntp
,chrony
centos7之前的版本采用ntp
进行时间同步,centos7及以后虽然ntp
任然可以使用,但是官方更加推荐使用chrony
ntp安装配置
安装ntp
yum -y install ntp
配置ntp
同步为阿里云服务器
vim /etc/ntp.conf
...
# aliyun
server ntp1.aliyun.com
server ntp2.aliyun.com
server ntp3.aliyun.com
...
启动ntp
systemctl start ntpd
验证ntp
ntpdate ntp1.aliyun.com
chrony安装配置
安装chrony
yum -y install chrony
配置chrony
vim /etc/chrony.conf
...
# aliyun
server ntp1.alyun.com
server ntp2.alyun.com
server ntp3.alyun.com
...
启动chrony
systemctl start chronyd
设置开机启动
systemctl start crond
systemctl enable crond
验证chrony
chronyc tracking