Operations 4 min read

How to Set Up and Synchronize NTP Across Multiple Linux Web Servers

This guide walks you through checking NTP status, viewing peers, manually syncing time, starting and enabling the NTP daemon at boot, verifying auto‑start, and customizing NTP servers to keep clocks consistent across many web servers.

ITPUB
ITPUB
ITPUB
How to Set Up and Synchronize NTP Across Multiple Linux Web Servers

Why synchronize time across web servers

When you operate several web servers, their system clocks must stay aligned; the Network Time Protocol (NTP) service ensures consistent timestamps for logs, authentication, and distributed processes.

Step 1: Check NTP status

Run ntpstat. If the output is Unable to talk to NTP daemon. Is it running? , the daemon is not running and should be configured to start on boot. If you see lines such as synchronised to NTP server (198.55.111.5) at stratum 3 , the service is already working. If the output contains unsynchronised , restart the daemon with service ntpd restart to re‑establish synchronization.

Step 2: View NTP peer list

Use ntpq -p to display the list of NTP servers the host is contacting.

NTP status output
NTP status output

Step 3: Manually synchronize time

Execute ntpdate. If you receive the NTP socket is in use. exiting , stop the running daemon first: service ntpd stop, then run ntpdate cn.pool.ntp.org. A successful run prints messages such as adjust time server xxx .

Step 4: Start the NTP service

Start the daemon with service ntpd start. The command should return [ OK ]. To ensure the service starts automatically after a reboot, enable it with chkconfig ntpd on.

Step 5: Verify auto‑start configuration

Run chkconfig --list ntpd. The output should indicate that ntpd is enabled for runlevels 2, 3, 4, and 5 (e.g., ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ), confirming correct boot‑time activation.

Step 6: Customize NTP servers

Edit the NTP configuration file (commonly /etc/ntp.conf) to add or replace server entries with the addresses of preferred time sources. After editing, restart the daemon to apply changes.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxNTPtime synchronizationServer Administrationsystem operations
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.