ntp開機自啟失敗


1 ntp開機無法自啟

1.1 查詢ntp狀態

[root@host-172-18-0-37 ~]# service ntpd status
Redirecting to /bin/systemctl status  ntpd.service
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: inactive (dead)

1.2 查詢ntp是否設置開機自啟

[root@host-172-18-0-37 ~]# systemctl is-enabled ntpd
enabled

說明ntp已經設置開機自啟,但是開機啟動並未成功。一般引起這個問題的最為常見的原因是系統上安裝了一個與NTP相沖突的工具:chrony。

1.3 查詢chrony是否被設置為enabled

[root@host-172-18-0-37 ~]# systemctl is-enabled chronyd
enabled

2 解決辦法

systemctl disable chronyd

重啟機器,查看ntp的狀態:

[root@host-172-18-0-37 ~]# service ntpd status
Redirecting to /bin/systemctl status  ntpd.service
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2018-04-27 14:11:59 CST; 4min 12s ago
  Process: 632 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 643 (ntpd)
   CGroup: /system.slice/ntpd.service
           └─643 /usr/sbin/ntpd -u ntp:ntp -g

Apr 27 14:11:59 localhost.localdomain ntpd[643]: Listening on routing socket on fd #20 for interface updates
Apr 27 14:11:59 localhost.localdomain ntpd[643]: 0.0.0.0 c016 06 restart
Apr 27 14:11:59 localhost.localdomain ntpd[643]: 0.0.0.0 c012 02 freq_set kernel 24.633 PPM
Apr 27 14:11:59 localhost.localdomain systemd[1]: Started Network Time Service.
Apr 27 14:12:03 host-172-18-0-37 ntpd[643]: Listen normally on 4 eth0 172.18.0.37 UDP 123
Apr 27 14:12:03 host-172-18-0-37 ntpd[643]: Listen normally on 5 eth0 fe80::f816:3eff:fefa:262c UDP 123
Apr 27 14:12:03 host-172-18-0-37 ntpd[643]: new interface(s) found: waking up resolver
Apr 27 14:12:10 host-172-18-0-37 ntpd[643]: 0.0.0.0 c61c 0c clock_step -225.297501 s
Apr 27 14:08:25 host-172-18-0-37 ntpd[643]: 0.0.0.0 c614 04 freq_mode
Apr 27 14:08:26 host-172-18-0-37 ntpd[643]: 0.0.0.0 c618 08 no_sys_peer

問題解決。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM