CentOS8系統時間同步解決方法
熱度 2,618 度裝了新的CentOS8,才發現有很多原來使用的工具在新版本中已經被其他工具替代,今天把常規的系統時間同步問題解決一下,CentOS7及以下的都是采用NTP來解決,《linux中rc.local設置開機自啟沒有生效解決方案》。
找了一下方法,原來是使用了另一個工具替代了,記錄一下先
[root@kiccleaf home]# yum install -y chrony Installed: chrony-3.5-1.el8.x86_64 timedatex-0.5-3.el8.x86_64 Complete! 安裝好工具,先啟動 [root@kiccleaf home]# systemctl start chronyd 設為系統自動啟動 [root@kiccleaf home]# systemctl enable chronyd 編輯一下配置文件 [root@kiccleaf home]# vim /etc/chrony.conf
/etc/chrony.conf配置文件內容:
# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). #pool 2.centos.pool.ntp.org iburst (這一行注釋掉,增加以下兩行) server ntp.aliyun.com iburst server cn.ntp.org.cn iburst
重新加載配置
[root@kiccleaf home]# systemctl restart chronyd.service [root@kiccleaf home]# chronyc sources -v 210 Number of sources = 2 .-- Source mode '^' = server, '=' = peer, '#' = local clock. / .- Source state '*' = current synced, '+' = combined , '-' = not combined, | / '?' = unreachable, 'x' = time may be in error, '~' = time too variable. || .- xxxx [ yyyy ] +/- zzzz || Reachability register (octal) -. | xxxx = adjusted offset, || Log2(Polling interval) --. | | yyyy = measured offset, || \ | | zzzz = estimated error. || | | \ MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 203.107.6.88 2 6 7 2 -188us[+6871us] +/- 24ms ^- 61.177.189.190 3 6 17 19 +663us[ +663us] +/- 97ms [root@kiccleaf home]# date Sat Aug 29 16:26:08 CST 2020