Hello All. I have an issue hoping all your input can be of help. Please bare with me as I am novice with UNIX. Let me know if anything I can clarify.

Users are reporting that a UNIX machine (CentOS Linux 7) time is nearly 20mins off from the time server.

There are 2 time servers which systems “should be” set to which are both Windows 10 machines.

Comparing with another UNIX machine (RHEL server v7) that does not have a time sync issue, they both seem to have the same setup in /etc/ntp.conf

We are able to manually change the time with the date --set “YYYYMMDD HH:MM” command although it changes once the machine/ntpd service is restarted and time sync is off again

“restart service ntpd” i s not a recognized command.

Any ideas? any additional info i can provide? anything that I can look further into?

appreciate the help and hope to learn more from this.

5 Spice ups

First make sure ntpd is installed.

yum install ntpd

Since centos 7 is a systemd configuration you need to use the systemctl command.

systemct status ntpd

systemctl start ntpd

and to enable ntpd on every reboot systemctl enable ntpd.

Just be aware that ntp will not correct if the time skew gets too large. So you can use the ntpdate command to set the local time to match the defined ntp server.

1 Spice up

thanks for the reply.first i checked to see the machines current time and it appears accurate at the moment. not sure when it goes out of sync.

i ran the commands as you stated. all successful other than yum install ntpd ended with result of “no package ntpd available. error: nothing to do”. is that expected?

after running all the commands i checked the time and still appears in sync at the moment

OK lets try

yum install ntp

Its been a while since I’ve used a rhel based system

1 Spice up

Also make sure the vm’s aren’t set to sync to the host ckock

1 Spice up

Here is the official Red Hat documentation that might save you a lot of time.

I suspect the Windows machine that acts as your time server.

Instead of the Windows machine, in /etc/ntp.conf, try setting server to

us.pool.ntp.org

See if that makes the problem goes away.

Also, from the problem system, make sure that us.pool.ntp.org is accessible:

ping  us.pool.ntp.org

Ditto for your Windows machine that is a time server.

FWIW, Cent 7 by default uses

Please consider joining the pool ( pool.ntp.org: Join the NTP Pool!) .

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst

server 3.centos.pool.ntp.org iburst

which seems to work just fine.

The package is ntp (sudo yum install ntp)

The systemd service is ntpd (sudo systemctl enable --now ntpd)

¯_(ツ)_/¯

thanks all for this advice! i am swamped with Monday items. Will be reviewing and trying these suggestions when I can

1 Spice up

Yes on all the good things said above about ntp, starting & enabling ntpd.service, if those systems were actually set up to use NTPD for their network time.
However. You might check to ensure that they do not also have chronyd.service running (systemctl status chronyd.service), because they are CentOS 7, the sysadmin who set them up may have decided to use chrony instead of ntpd for network time synchronization.
If both are running, choose one to configure and run.
Also, Linux network time services (chrony especially) may not synchronize correctly with older Windows systems, as those don’t see Windows as an authoritative or trusted time source. Chrony can be sensitive to network distance, (by design for security), and a larger “maxdistance” parameter configured in your /etc/chrony.conf to overcome. (that only if someone set up chrony instead of ntp on those)
Plenty of people in “air-gapped” networks have to make the choice to sync to something else besides the public CentOS servers, on their local disconnected networks, Microsoft has some good kb articles on subject.