Configuring time synchronization

To configure time synchronization with NTP servers:

  1. Install the chrony package. To do so, run one of the following commands depending on the utilized operating system:
    • CentOS or Red Hat Enterprise Linux:

      yum install -y chrony

    • SUSE Linux Enterprise Server:

      zypper install chrony

    • Ubuntu, Debian, or ALT Server:

      apt-get install chrony

  2. Enable autostart of the chronyd service. To do so, run one of the following commands depending on the utilized operating system:
    • Ubuntu, Debian, or ALT Server:

      systemctl enable chrony

    • Other operating systems:

      systemctl enable chronyd

  3. Depending on the operating system, open one of the following files:
    • CentOS, Red Hat Enterprise Linux or SUSE Linux Enterprise Server:

      /etc/chrony.conf

    • Debian, Ubuntu, or ALT Server:

      /etc/chrony/chrony.conf

  4. Add strings with the IP addresses of those NTP servers with which you want to configure time synchronization. For example:

    server <IP address of the NTP server> iburst

  5. Comment the strings beginning with the word pool or server that have the IP addresses of those NTP servers that you do not want to use for time synchronization (to "comment" means to add the # character at the beginning of the string).
  6. If you are using a Windows domain controller for time synchronization, add the following string:

    maxdistance 16.0

  7. Save and close the /etc/chrony.conf file.
  8. Restart the chronyd service. To do so, run one of the following commands depending on the utilized operating system:
    • Ubuntu, Debian, or ALT Server:

      systemctl restart chrony

    • Other operating systems:

      systemctl restart chronyd

  9. Verify the time synchronization. To do so, execute the command:

    chronyc sources -v

    If the displayed IP addresses match the addresses of the NTP servers that you specified in the chrony.conf file, synchronization was correctly configured.

Time synchronization between the Squid server and NTP servers will be configured.

Page top