Linux同步时间时出现的问题:the NTP socket is in use, exiting

Linux上执行ntpdate cn.pool.ntp.org命令实现同步操作系统时间时出现的问题,
执行命令后,过段时间查看还是不准,手动执行ntpdate命令时还报错了~
报错信息如下:

[root@hadoop101 ~]# ntpdate time.nuri.net
27 May 13:31:21 ntpdate[37725]: the NTP socket is in use, exiting

分析:可能是NTP服务被占用导致的
解决:停止NTP服务,执行ntpdate同步命令 => 同步成功

具体步骤如下:

  1. 停止ntp服务
[root@hadoop101 ~]# service ntpd stop
关闭 ntpd:                                                [确定]
  1. 关闭ntp服务的开机自启:
[root@hadoop101 ~]# chkconfig ntpd off
  1. 再次执行ntpdate同步命令(同步完成!!!)
    注:一定要在root账户下执行该命令
[root@hadoop101 ~]# /usr/sbin/ntpdate cn.pool.ntp.org
28 May 19:35:58 ntpdate[37762]: step time server 203.107.6.88 offset 108152.003980 sec
  1. 查看时间
[root@hadoop101 ~]# date
2019年 05月 28日 星期二 19:36:04 CST
  1. 最后启动前边关闭的服务
[root@hadoop101 ~]# chkconfig ntpd on
[root@hadoop101 ~]# service ntpd start
正在启动 ntpd:                                            [确定]

以下是centOS7版本命令:

  • NTP服务开启and关闭:
    systemctl start ntpd.service
    systemctl stop ntpd.service

  • 开启and关闭ntp服务的开机自启
    systemctl enable ntpd.service
    systemctl disable ntpd.service

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值