Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux ntp time synchronization configuration

Shulou Source: shulou.com Published: 2022-06-02 08:12:26 10月02日 Update

Chapter 1 introduction to building 1.1ntp for ntp time server

NTP (NetworkTime Protocol, Network time Protocol) is a protocol used to synchronize the time of various computers in the network. Its purpose is to synchronize the computer clock to UTC UTC. Its accuracy can reach 0.1ms in the local area network and 1-50ms in most places on the Internet.

NTP server uses NTP protocol to provide time synchronization service.

1.2NTP server installation 1. # the system comes with ntp2. [root@oldboyedu] # rpm-qa ntp3. Ntp-4.2.6p5-5.el6.centos.x86_644. # if not, install 5. Yum-y install ntp1.3 configure ntp time server

[root@oldboyedu ~] # vim/etc/ntp.conf

# restrict default kod nomodifynotrap nopeer noquery

Restrict default nomodify

# nomodify clients can synchronize

# change the default time synchronization source annotation to an available source

# server 0.centos.pool.ntp.orgiburst

# server 1.centos.pool.ntp.orgiburst

# server 2.centos.pool.ntp.orgiburst

# server 3.centos.pool.ntp.orgiburst

Server ntp1.aliyun.com

Server time.nist.gov

Start the NTP server

[root@oldboyedu ~] # / etc/init.d/ntpdstart

Starting ntpd: [OK]

[root@oldboyedu] # ntpq-p

Remote refid st t when poll reach delay offset jitter

=

* ntp1.aliyun.com 10.137.38.86 2 u 22 64 1 525.885-42.367 0.000

[root@oldboyedu ~] # ntpstat

Synchronised to NTP server (110.75.186.247) at stratum 3

Time correct to within 4257 ms

Polling server every 64 s

[root@oldboyedu ~] # ntpdate10.0.0.9

7 Dec 18:43:07 ntpdate [26950]: the NTP socketis in use, exiting

1.4 client time synchronization

The client will have to wait a few minutes before synchronizing with the newly started ntp server, otherwise it will prompt a no serversuitable for synchronization found error.

[root@zyops ~] # ntpdate 10.0.0.9

7 Dec 18:40:16 ntpdate [1453]: step time server10.0.0.9 offset 40.880807 sec

# just put the command into the scheduled task.

Tags: Time synchronization service server client precision network computer configuration world task command place client client that is local area local area network clock to make Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Technology Huawei Apple macOS