CentOS 时间同步(ntpdate命令与 no server suitable for synchronization found 错误)

版权声明:版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/shaotaiban1097/article/details/83153204

时间同步

查看 ntpdate 命令完整路径

因为 CentOS 5 和 CentOS 6 的 ntpdate 命令所在目录不同。
所以我们可以使用 which ntpdate 在root用户下来查看命令的完整目录

[root@mode ~]# cat /etc/centos-release
CentOS release 6.10 (Final)
[root@mode ~]# which ntpdate
/usr/sbin/ntpdate

时间同步

[root@mode ~]# ntpdate time.nist.gov 

如果命令无法执行:

[root@mode ~]# /usr/sbin/ntpdate time.nist.gov 
28 Aug 03:45:25 ntpdate[63001]: no server suitable for synchronization found 

可以尝试以下办法:
1、尝试关闭防火墙

[root@mode ~]# /etc/init.d/iptables stop

2、检查网络是否通畅

[root@mode ~]# ping www.baidu.com

3、查看域名解析是否正常(以CentOS 6.5为例。其他版本命令路径可能不同 )

[root@mode ~]# nslookup time.nist.gov
Server:         114.114.114.114
Address:        114.114.114.114#53

Non-authoritative answer:
time.nist.gov   canonical name = ntp1.glb.nist.gov.
Name:   ntp1.glb.nist.gov
Address: 128.138.141.172

如上提示:无法找到time.stdtime.gov服务。规范名称 ntp1.glb.nist.gov.
所以可以尝试更换名称执行:

[root@mode ~]# /usr/sbin/ntpdate ntp1.glb.nist.gov.                
18 Oct 20:57:27 ntpdate[32191]: step time server 128.138.141.172 offset 4466016.462504 sec

成功

猜你喜欢

转载自blog.csdn.net/shaotaiban1097/article/details/83153204
今日推荐