In this Article, you will learn how to synchronize and configure time in Linux with chrony and “timedatectl” tool.
May 02, 2018 Microsoft Windows Server 2008, Server 2003. Change the server type to NTP. Registry Key: HKEYLOCALMACHINE SYSTEM CurrentControlSet Services W32Time Parameters Type. Change value data to. Set announce flags. Registry Key. NAME ntpdate - set the date and time via NTP ntpdate sets the local date and time by polling the Network Time Proto‐ col (NTP) server(s) given as the server arguments to determine the cor‐ rect time. It must be run as root on the local host (unless the option -q is used).
The correctness of time in an Operating system is very important, especially if it is a log system/server that has to do with tracking of various logs and activities at a particular time, correct timing, in this case, is essential. More so, systems that are used in Financial or government sectors cannot afford not to have the correct time set. Hence the time of these particular sets of systems and their likes must be correct and well synchronized at all times.
A virtualization Engineer who configures clustering and High availability services can tell how important all the systems that will be clustered must have the same time and must be synchronized at all times to avoid malfunction of a clustered environment.
In most operating systems, Linux inclusive, correct timing can be done with the use of NTP (Network Time Protocol) services.
Network time protocol (NTP) is a protocol that is used to automatically synchronize time over a network. NTP is server/client based, whereby NTP servers are sitting somewhere as a pool of servers in different zones and regions and NTP client will be configured on a Linux system to synchronize time from an NTP server.
There are a few numbers of NTP server pool, a Linux OS by default knows how to use the one closer to the region that is selected during the installation of the operating system. Some clustered environment prefers to have an internal central NTP server configured so that other systems in the environment will synchronize time from it.
In old distributions of RHEL servers and some other distributions, the ntpd daemon with the “ntpdate” tool is the client that is used to synchronize the time of a Linux system over a network from the NTP server, but in newer versions of RHEL and some other distributions, “ntpdate” tool /ntpd daemon has been deprecated and the new NTP client responsible for NTP time synchronization from the NTP server is chrony. The chronyd daemon must be up and running on the system before there can be synchronization.
There have been a lot of controversial discussions as regards why ntp was joined with chrony in RHEL 7 and finally deprecated in RHEL 8. Some agreed ntp is better than chrony in many ways while some disagreed. Well, you may drop your perspective in the comment section. It is not a doubt that there are differences between the two even if their configuration files are almost similar,You may want to click the link below to check their differences.
Moving forward, since chrony is the new NTP client, we are going to go through the step by step process of how to use “chrony” to synchronize time, and use the “timedatectl” utility to configure time in the ACTION TIME” section.
Before we roll down to the “ACTION TIME” section, let’s understand the chrony configuration file.
The chrony configuration file can be found in the path “/etc/chrony.conf” on a RHEL 7/8 server and some other distributions and can be seen after chrony is installed.
After synchronization of time from NTP server has been done, you may want to use the command below to set the system hardware clock
For more usage of the of the hwclock utility, refer to the hwclock manual page.
Please note, time configuration in Linux can be and not be simple, so if you don’t know what you are doing, don’t tamper with the chrony configuration file. Just leave it as it is.
Installation of chrony comes with the chronyc tool as well. The chronyc tool is the CLI for chrony and can be used to interact and make changes to chrony. we will use this tool in the “ACTION TIME” section.
If chrony is not installed on your distribution, use the command below to install chrony.
By default, chrony is installed on RHEL/CentOS 7 & 8 systems
For example, to set the time zone to Africa, Cairo, use the command,
To manually synchronize time, use the command
As explained in “UNDERSTANDING THE SUBJECT MATTER, in my case, my NTP server is ” pool 2.rhel.pool.ntp.org iburst” , therefore, I will use the command,
. Manufacturer's Suggested Retail PriceDisclaimer: Glass's Information Services (GIS) and Carsguide Autotrader Media Solutions Pty Ltd. Our database has the answer.Everything you need to know to keep you and your family as safe as possible.Helpful advice before you finance your next car.Tips for getting the right insurance and how to make a claim.Everything you need to know when sizing up your new car. (carsguide) provide this information based on data from a range of sources including third parties. Ford econovan service manual download.
To verify if there is synchronization with chronyc tool, use the command,
To verify the current time source, use the command,
For more detailed source listing, use the command,
Your feedback is welcomed. If you love others, you will share with others