2015/10/11

chrony 網路對時服務


----
chrony 網路對時服務
----
NTPd 套件在 CentOS 7 以後,逐漸被棄用了。改成 chrony 套件提供服務

# 安裝 chrony 移除 ntp ,並啟動服務
yum remove -y ntp
yum install -y chrony
systemctl start chronyd.service
systemctl enable chronyd.service

# 驗證程序是否工作
[root@hnamenode ~]# systemctl status chronyd.service
chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
   Active: active (running) since Sat 2015-10-10 15:57:08 CST; 23h ago
 Main PID: 886 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─886 /usr/sbin/chronyd -u chrony

Oct 10 15:57:08 hnamenode.cm.nsysu.edu.tw systemd[1]: Starting NTP client/server...
Oct 10 15:57:08 hnamenode.cm.nsysu.edu.tw chronyd[886]: chronyd version 1.29.1 starting
Oct 10 15:57:08 hnamenode.cm.nsysu.edu.tw chronyd[886]: Linux kernel major=3 minor=10 patch=0
Oct 10 15:57:08 hnamenode.cm.nsysu.edu.tw chronyd[886]: hz=100 shift_hz=7 freq_scale=1.00000000 nominal...l=2
Oct 10 15:57:08 hnamenode.cm.nsysu.edu.tw chronyd[886]: Frequency -21.302 +/- 0.046 ppm read from /var/...ift
Oct 10 15:57:08 hnamenode.cm.nsysu.edu.tw systemd[1]: Started NTP client/server.
Oct 10 15:57:22 hnamenode.cm.nsysu.edu.tw chronyd[886]: Selected source 120.119.31.1
Oct 10 16:02:32 hnamenode.cm.nsysu.edu.tw chronyd[886]: Selected source 140.117.69.1
Oct 11 15:36:00 hnamenode.cm.nsysu.edu.tw systemd[1]: Started NTP client/server.
Hint: Some lines were ellipsized, use -l to show in full.

# 觀看目前的同步狀態
[root@hnamenode ~]# chronyc sources -v
210 Number of sources = 4

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||                                                /   xxxx = adjusted offset,
||         Log2(Polling interval) -.             |    yyyy = measured offset,
||                                  \            |    zzzz = estimated error.
||                                   |           |                        
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* cm.nsysu.edu.tw               3  10   377   903  +7941ns[  +35us] +/-   22ms
^- atelieralica.idv.tw           3   9   135   410    -52ms[  -52ms] +/-  426ms
^- venus.stu.edu.tw              2  10   377    63  -3401us[-3401us] +/-   71ms
^- edm.butyshop.com              3   9   337   398  -3305us[-3305us] +/-   66ms
張貼留言

like