Linux下 ntp 时间同步服务ntpd 出现 the NTP socket is in use, exiting 解决

博客介绍了在Linux中进行主从节点时间同步时遇到的问题及解决办法。先查看ntp服务是否开启,若已开启则需用root权限手动停止ntp服务,之后便可执行节点间的时间同步。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在Linux中将主从节点进行时间同步的时候,会出现如下所示的问题:

[admin@admin02 ~]$ sudo ntpdate admin01
10 Jul 10:58:33 ntpdate[2472]: the NTP socket is in use, exiting

首先,使用命令ps -aux | grep ntp查看ntp服务是否已经正常开启

[admin@admin02 ~]$ ps aux | grep ntpd
ntp       1544  0.0  0.1  26492  1916 ?        Ss   10:20   0:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
admin     2481  0.0  0.0 103256   832 pts/1    S+   11:00   0:00 grep ntpd

如上所示的ntp服务已经开启,此时需要手动的将ntp服务停止(注意的是需要使用root权限进行操作)

[root@admin02 init.d]# ./ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@admin02 init.d]# ps aux | grep ntpd
root      2571  0.0  0.0 103252   832 pts/1    S+   11:09   0:00 grep ntpd

接下来,便可执行对节点间的时间同步问题

[root@admin02 init.d]# ntpdate 192.168.47.101
10 Jul 11:10:02 ntpdate[2574]: adjust time server 192.168.47.101 offset 0.262839 sec
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值