ntpdate[1788]: the NTP socket is in use, exiting

当初搭建RAC环境(虚拟机上搭建)的时候使用了NTP来同步时间,今天启动的时候时间不同步了,在客户端上执行同步时间的命令,出现了

以下错误:

[root@vmac1 ~]# crontab -l
0 * * * * ntpdate 192.168.3.102 >> /root/ntpdate.log 2>&1
[root@vmac1 ~]# ntpdate 192.168.3.102 >> /root/ntpdate.log 2>&1
[root@vmac1 ~]# date
Thu Mar 26 15:37:25 EDT 2015
[root@vmac1 ~]# cat /root/ntpdate.log

…………
/bin/sh: ntpdate: command not found
26 Mar 15:17:04 ntpdate[21342]: the NTP socket is in use, exiting
26 Mar 15:31:17 ntpdate[22056]: the NTP socket is in use, exiting
26 Mar

解决方法
您收到此错误消息的原因是由于 xntpd 已经绑定到了该 Socket。运行 ntpdate 时,它会首先进行广播,然后侦听端口 123。如果 xntpd 正在运行,而有一个进程已经在侦听该端口了,则会使 ntpdate 无法在上面运行。运行下列命令,即可找出 xntpd 的 PID
ps -ef|grep xntpd
可惜没有找到pid。
使用lsof –i:123

[root@vmac1 ~]#  lsof -i:123
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ntpd    22333  ntp   16u  IPv4 258219      0t0  UDP *:ntp 
ntpd    22333  ntp   17u  IPv6 258220      0t0  UDP *:ntp 
ntpd    22333  ntp   18u  IPv6 258221      0t0  UDP localhost6.localdomain6:ntp 
ntpd    22333  ntp   19u  IPv6 258222      0t0  UDP [fe80::a00:27ff:fe81:e568]:ntp 
ntpd    22333  ntp   20u  IPv6 258223      0t0  UDP [fe80::a00:27ff:fec4:3897]:ntp 
ntpd    22333  ntp   21u  IPv6 258224      0t0  UDP [fe80::a00:27ff:fe2b:9a3c]:ntp 
ntpd    22333  ntp   22u  IPv4 258225      0t0  UDP rac1.localdomain:ntp 
ntpd    22333  ntp   23u  IPv4 258226      0t0  UDP 192.168.3.101:ntp 
ntpd    22333  ntp   24u  IPv4 258227      0t0  UDP vmac1:ntp 
ntpd    22333  ntp   25u  IPv4 258228      0t0  UDP vmac1-vip:ntp 
ntpd    22333  ntp   26u  IPv4 258229      0t0  UDP vmac-cluster:ntp 
ntpd    22333  ntp   27u  IPv4 258230      0t0  UDP vmac1-priv:ntp 
[root@vmac1 ~]# kill -9 22333
[root@vmac1 ~]# lsof -i:123
[root@vmac1 ~]# crontab -l
0 * * * * ntpdate 192.168.3.102 >> /root/ntpdate.log 2>&1


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

huangliang0703

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值