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
posted @   人艰不拆_zmc  阅读(2829)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示