The same error may occur when working with timedatectl: Failed to set time: Automatic time synchronization is enabled. To manually synchronize the time, stop the ntpd daemon: This means that the ntpd daemon is running and is preventing manual time synchronization. # ntpdate ntpdate : the NTP socket is in use, exiting
In this section, I will describe typical errors that appear when working with timedatectl, ntp.ĭuring the manual time synchronization you may come across this error: If you want to set the specific date and time manually, you can use date, but previously disable the chronyd daemon. To view the information about sync servers: To view the information about the current time synchronization options, run this command: Like ntp, chrony has a command-line interface: chronyc. Specify the list of NTP servers you want to use for synchronization.
To make sure that the time synchronization is working, run this command:Ĭhrony configuration file is /etc/nf. Like any other service, chrony needs to be started and added to startup after installation: By default, time is not modified right after the synchronization to prevent any problems for running programs īy default, chrony is already installed in CentOS Linux, but if you don’t have it on some reason, install it:.Proper operation if you don’t have access to master clock (ntpd requires regular requests).High speed and accuracy of time synchronization.In CentOS 8 you will have to use chrony to synchronize time, since ntp and ntpdate have been removed from the official repositories. # ntpdate How to Sync Time in CentOS 8 using Chronyd? If you cannot use the ntpd daemon, you can configure time synchronization using cron. It means that time will be synchronized every 11 minutes. You can synchronize time with the specified NTP server manually using this command:īy default, ntpd enables “11 minute mode”. If the first NTP server is not available, the second one is used, etc. Specify the NTP servers to synchronize time with in / etc/ntp.conf: server 0. Loaded: loaded (/usr/lib/systemd/system/rvice enabled vendor preset: disabled)Īctive: active (running) since Thu 15:37:33 +06 5min ago # service ntpd status Redirecting to /bin/systemctl status rvice After the installation, start the ntpd service and add it to startup: