错误: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