CHRONY time server

Time Synchronization Service chrony

  • Ntp network time synchronization protocol used previously Protocol
  • Achieve chrony ntp protocol ntp service compatible network (no longer used ntp after centos7, instead use chrony)
  • rpm -ql chrony
  • The main configuration file /etc/chrony.conf
  • systemctl status chronyd (to see if the start)
  • 323 port utp of listening, chrony time synchronization
  • chronyc internal tool has many command contains can be used to set up profiles, including adding time server, see the synchronous case, delete time server, view server and so on, said there are several time
  • Configuration file (centos7) server server address iburst, can be multiple, Hong Kong's default address (centos8) poor server address iburst (ntp.aliyun.com Ali's time server)

    Internal configuration

  • To build a time machine synchronization, Internet time synchronization with the server, and let the internal server to get the current server time

    (Server)

  • Need to change the server configuration file allow allow others to use my time synchronization
  • Set the time from server time to get where, for example, from Ali cloud: ntp.aliyun.com iburst server
  • When the time is unavailable network time server to enable local hardware time-based: local stratum 10
  • After setting the restart time service: systemctl restart chronyd

    (Client)

  • Need to change the configuration file to a local area network time synchronization from time servers: server 192.168.47.25 iburst
  • After setting the restart time service: systemctl restart chronyd
  • ntpdate ip immediately synchronized time and the target host
  • Case chronyc sources -v command and then view the target synchronization

    (test)

  • date -s '-1 year' Set the current time is reduced year
  • If you need more anxious to observe a few moments after the restart the service time will be synchronized
  • Ali provides time synchronization server: ntp.aliyun.com ~ ntp7.aliyun.com

    Write a script to change the configuration file

  • sed -ri 's/^#s.*t$/ server 192.168.47.25 iburst/g' /etc/chrony.conf ;systemctl restart chronyd

Guess you like

Origin www.cnblogs.com/Justin0717/p/11845206.html