时钟同步报错

错误:Exiting, name server cannot be used: Temporary failure in name resolution (-3)31 Oct 09:23:51 ntpdate[24590]: name server cannot be used: Temporary failure in name resolution (-3)

解决方法:

     关闭防火墙:service iptables stop

     开机自动关闭防火墙:chkconfig iptables off

     修改/etc/resolv.conf文件:  vi /etc/resolv.conf

        nameserver 8.8.8.8

*(注意这里是4个8)

正常运行:

重启nptd服务 service ntpd restart

同步阿里云的时间 ntpdate ntp1.aliyun.com

 

 

 

错误:ntpdate[24571]: the NTP socket is in use, exiting

解决方法:

service ntpd stop

正常运行:

ntpdate ntp1.aliyun.com

 

 

错误:定时器crontab时间同步无效

 原因:

需要使用绝对路径 /usr/sbin/ntpdate

解决方法:

使用以下方式可以正常时间同步

* * * * * /usr/sbin/ntpdate ntp1.aliyun.com > /var/logntpdate.log

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值