Lab activity

Time Synchronization with Chrony

Learn how to configure, verify, and troubleshoot system time synchronization using Chrony, including NTP sources, timezones, tracking, and service management.

Overview

In this lab, you will learn how to configure time synchronization using Chrony, the default NTP implementation on RHEL. You will inspect the current time and synchronization status, configure an NTP time source, enable and manage the chronyd service, and verify synchronization using Chrony commands. You will also learn how to inspect time source statistics, check tracking information, configure the system timezone, and troubleshoot synchronization issues using system logs and Chrony diagnostics.

Learning Outcomes

  • Understand the role of Chrony in system time synchronization.
  • Configure NTP time sources in /etc/chrony.conf.
  • Enable and manage the chronyd service.
  • Verify configured time sources using chronyc sources.
  • Analyze time source statistics using chronyc sourcestats.
  • Check synchronization and clock tracking using chronyc tracking.
  • Verify system-wide NTP synchronization using timedatectl.
  • Configure and verify the system timezone.
  • Use Chrony activity information and system logs to troubleshoot synchronization problems.

Key Concepts

  • Chrony: The default NTP implementation on RHEL used to synchronize the system clock with remote time sources.
  • NTP Source: A server or pool that provides accurate time information to the local system.
  • chronyd: The background service responsible for synchronizing and maintaining the system clock.
  • iburst: An option that allows Chrony to send a burst of packets when starting synchronization, helping the system synchronize more quickly.
  • chronyc: A command-line client used to monitor and manage the Chrony service.
  • Clock Tracking: Information about the selected reference clock, clock offset, frequency, and synchronization status.
  • Timezone: Controls how synchronized UTC time is displayed as local time without changing the underlying NTP synchronization.
  • Drift File: Stores information about the local hardware clock's frequency drift so Chrony can compensate for it.

Why Needed?

  • Accurate Logging: Keeps timestamps consistent across systems, making logs easier to correlate and investigate.
  • Authentication: Accurate time is important for time-sensitive authentication mechanisms such as Kerberos.
  • System Coordination: Helps distributed systems and clustered environments maintain consistent timestamps.
  • Reliable Troubleshooting: Synchronized clocks make it easier to trace events across multiple systems.
  • Persistent Synchronization: Configuring chronyd to start automatically ensures time synchronization continues after system reboots.