[CentOS7]chrony 時間同步


參考文獻

https://docs.fedoraproject.org/en-US/Fedora/18/html/System_Administrators_Guide/sect-Checking_if_chrony_is_synchronized.html

安裝

yum install -y chrony

修改配置文件

cp /etc/chrony.conf /etc/chrony.conf.bak
sed -i '/^server/d' /etc/chrony.conf
sed -i '2a server ntp1.aliyun.com' /etc/chrony.conf
sed -i '2a server ntp2.aliyun.com' /etc/chrony.conf
sed -i '2a server ntp3.aliyun.com iburst\nallow 10/8' /etc/chrony.conf

啟動服務

systemctl start chronyd && systemctl enable chronyd

設置時區

timedatectl set-timezone Asia/Shanghai

查看時間源

[root@ntp ~]# 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    17    38   -883us[-2553us] +/-   20ms
^? 120.25.115.20                 2   6     1    44   +624us[-3946ms] +/-   25ms

強制更新時間

chronyc -a makestep

END


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM