ntp同步报错解决
服务端:192.168.1.204 主机名: www.test.com
客户端:192.168.1.206 主机名: www.test3.com
客户端同步服务端报错如下:
[root@www etc]# ntpdate -d -b 192.168.1.204
9 Dec 22:42:10 ntpdate[10293]: ntpdate 4.2.6p5@1.2349-o Fri Apr 13 12:52:28 UTC 2018 (1)
Looking for host 192.168.1.204 and service ntp
host found : bogon
transmit(192.168.1.204)
transmit(192.168.1.204)
transmit(192.168.1.204)
transmit(192.168.1.204)
transmit(192.168.1.204)
192.168.1.204: Server dropped: no data
server 192.168.1.204, port 123
stratum 0, precision 0, leap 00, trust 000
refid [192.168.1.204], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Sun, Dec 31 1899 19:00:00.000
originate timestamp: 00000000.00000000 Sun, Dec 31 1899 19:00:00.000
transmit timestamp: dfb85f18.7c676b92 Sun, Dec 9 2018 22:42:16.485
filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000
9 Dec 22:42:18 ntpdate[10293]: no server suitable for synchronization found
解决:
1、添加解析
配置192.168.1.206的 hosts 添加服务端的ip地址和域名即可解决
sed -i '$a\192.168.1.204 www.test.com' /etc/hosts
2、重启客户端主机、重启客户端 ntp
3、重启服务端主机、重启服务端 ntp
4、再次同步成功
[root@www etc]# ntpdate -d -b 192.168.1.204
9 Dec 22:50:33 ntpdate[10835]: ntpdate 4.2.6p5@1.2349-o Fri Apr 13 12:52:28 UTC 2018 (1)
Looking for host 192.168.1.204 and service ntp
host found : www.test.com
transmit(192.168.1.204)
receive(192.168.1.204)
transmit(192.168.1.204)
receive(192.168.1.204)
transmit(192.168.1.204)
receive(192.168.1.204)
transmit(192.168.1.204)
receive(192.168.1.204)
server 192.168.1.204, port 123
stratum 2, precision -25, leap 00, trust 000
refid [192.168.1.204], delay 0.02643, dispersion 0.00026
transmitted 4, in filter 4
reference time: dfb8603a.eb00f583 Sun, Dec 9 2018 22:47:06.917
originate timestamp: dfb8610f.7f3f2a5e Sun, Dec 9 2018 22:50:39.497
transmit timestamp: dfb8610f.802d9b91 Sun, Dec 9 2018 22:50:39.500
filter delay: 0.03288 0.02699 0.02654 0.02643
0.00000 0.00000 0.00000 0.00000
filter offset: -0.00560 -0.00401 -0.00404 -0.00417
0.000000 0.000000 0.000000 0.000000
delay 0.02643, dispersion 0.00026
offset -0.004177
9 Dec 22:50:39 ntpdate[10835]: step time server 192.168.1.204 offset -0.004177 sec