• 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. pacman –upgrade Command Examples in Linux
  2. “btrfs” command examples to Create and Manage Btrfs File System
  3. ipset Command Examples in Linux
  4. ss: command not found
  5. mons Command Examples in Linux
  6. smbclient Command Examples in Linux
  7. How to load SELinux Module For Oracleasm
  8. RPM : package installation Error : cpio: read failed
  9. mktemp: command not found
  10. How To Disable MD5-based HMAC Algorithm’s for SSH

You May Also Like

Primary Sidebar

Recent Posts

  • “aws s3 mv” Command Examples
  • “aws s3 mb” Command Examples
  • “aws s3 ls” Command Examples
  • “aws s3 cp” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright