• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Time goes out of sync on a node running CentOS/RHEL 7

by admin

The Scenario

The system is not configured to use the ntpd service to synchronize time and date.

CentOS/RHEL 7 uses systemd to manage services. The timedatectl utility is distributed as part of the systemd, and allows you to review and change the configuration of the system clock: change the current date and time, set the time zone, or enable automatic synchronization of the system clock with a remote server.

The NTP service is enabled, but as this system is running CentOS/RHEL 7, timedatectl also needs to be configured to enable NTP, as it is used to manage the date and time on the system.

# timedatectl
...
NTP enabled: no
...

This shows system is not using NTP.

The Solution

Force NTP usage for time synchronisation:

# timedatectl set-ntp 1

Then do the following:

1. Restart systemd time date control.

# systemctl restart systemd-timedated.service

2. Start the ntp service

# systemctl start ntpd

3. Sync the time with the remote server

# ntpq -p

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to Install dmg File on Mac from Command Line
  2. How to disable IPv6 on CentOS / RHEL 7
  3. How to use netstat command under Linux (Examples included)
  4. krita: command not found
  5. CentOS / RHEL : DNS servers in /etc/resolv.conf change after a reboot/network service restart. How to make them permanent
  6. ssh-add: command not found
  7. Magento 2.3.3 Redis cache grows unlimited
  8. lvs: command not found
  9. CentOS / RHEL 6 : Install and Configure SNMPv3
  10. Unable to start Nagios Service (CentOS/RHEL)

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright