Centos 7/8 Chronyd時間同步


Chronyd

chronyd是一個同步系統時鍾的守護進程。

從Centos7開始默認安裝時鍾同步服務chronyd,而不是ntpd。

# dnf -y install chronyd
# eccho 'server ntp1.aliyun.com iburst' >> /etc/chrony.conf
# systemctl enable chronyd.service && systemctl start chronyd.service

 

Chronyc

chronyc is a command-line interface program which can be used to monitor chronyd’s performance and to change various operating parameters whilst it is running.

# chronyc sources -v
  .-- 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               
===============================================================================
^* classroom.example.com         8  10   377  1000   +130us[ +147us] +/-  819us

 

Timedatectl

Query or change system time and date settings.

set-timezone

  設置時區,也可以手動執行localtime軟連接

  # timedatectl set-timezone Asia/Shanghai
  # ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

set-ntp BOOL

  和chrony配置的ntp server進行時間同步

set-time TIME

  手動設置日期時間

 


免責聲明!

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



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