In this video you'll learn how to configure time synchronization on Red Hat.
So Red Hat uses a crony service to manage time
synchronization and this service is managed by the timedatectl utility.
Configuration of Chrony itself is in the etccronie configuration file. That's
where you set your time sources to synchronize with. And next
you use chrony C sources to check current synchronization status.
Let's check.
So I'm starting by using sudo systemctl status of chronyd
and there we can see that chronyd is currently loaded.
You can also see in the logs to the end that it's currently synchronizing. It's having a good time and seems to be doing all right.
Now I would like to edit this configuration file. So sudo vim
on etc chrony conf that's the main configuration file. And as you
can see, it has a pool. And this pool is pretty reliable.
It's a pool of Internet time servers.
Now if you want, you can add your own server and I'm going to add a server
dummy example and that should make a point. This is a server that doesn't exist, but I
want to show you what is happening in case you have a server that doesn't exist.
Now, I did just change the configuration for Chrony, so I need to restart it.
Let's do that right now.
And then I can check what is going on first by checking on the status.
And on the status we see what? Well, we don't see any errors whatsoever. Seems to be doing all right.
Now the ultimate command to figure out if your time
is synchronizing correctly is by using chrony C sources.
So here we can see the current time sources that it is using and they are listed
right here. And hey, there's no mention of this dummy time server. And we don't need to
because this dummy time server couldn't be contacted. So you don't see it in the sources.
We do see a source.
Oh, that's a stratum one fancy.
So 192192630 stratum one most reliable. And you can also see that the
difference between the local clock and this remote clock is really minimal.
It's also in touch with a couple of other time servers, which is helpful in case you lose contact with the
Stratum 1 server. Then it has a fallback for other servers. That's how you use time synchronization on Red Hat.