1. 程式人生 > >NTP服務器的部署

NTP服務器的部署

防火墻 lte fse csharp serve ble install 2.6 -c

安裝方式:

yum install ntp -y

文件位置: /etc/ntp.conf

restrict ntp服務的防火墻

server ntp服務需要同步時間的上層ntp服務器

錯誤排查:

[[email protected] ~]# ntpdate -d 192.168.100.100
10 Apr 23:03:12 ntpdate[1155]: ntpdate [email protected] Fri Apr 13 12:52:28 UTC 2018 (1)
Looking for host 192.168.100.100 and service ntp
host found : 192.168.100.100
transmit(192.168.100.100)
transmit(192.168.100.100)
transmit(192.168.100.100)
transmit(192.168.100.100)
transmit(192.168.100.100)
192.168.100.100: Server dropped: no data
server 192.168.100.100, port 123
stratum 0, precision 0, leap 00, trust 000
refid [192.168.100.100], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Mon, Jan  1 1900  8:05:43.000
originate timestamp: 00000000.00000000  Mon, Jan  1 1900  8:05:43.000
transmit timestamp:  e0588436.d5e0ea36  Wed, Apr 10 2019 23:03:18.835
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

10 Apr 23:03:20 ntpdate[1155]: no server suitable for synchronization found

  出現no date,說明是防火墻或者firewall或者restrict 做了限制

[[email protected] ~]# ntpdate -d 192.168.100.100
11 Apr 06:46:45 ntpdate[1217]: ntpdate [email protected] Fri Apr 13 12:52:28 UTC 2018 (1)
Looking for host 192.168.100.100 and service ntp
host found : 192.168.100.100
transmit(192.168.100.100)
receive(192.168.100.100)
transmit(192.168.100.100)
receive(192.168.100.100)
transmit(192.168.100.100)
receive(192.168.100.100)
transmit(192.168.100.100)
receive(192.168.100.100)
192.168.100.100: Server dropped: strata too high
server 192.168.100.100, port 123
stratum 16, precision -24, leap 11, trust 000
refid [192.168.100.100], delay 0.02606, dispersion 0.00003
transmitted 4, in filter 4
reference time:    00000000.00000000  Mon, Jan  1 1900  8:05:43.000
originate timestamp: e058807e.05119c87  Wed, Apr 10 2019 22:47:26.019
transmit timestamp:  e058f0db.acb31585  Thu, Apr 11 2019  6:46:51.674
filter delay:  0.02606  0.02643  0.02658  0.02640 
         0.00000  0.00000  0.00000  0.00000 
filter offset: -28765.6 -28765.6 -28765.6 -28765.6
         0.000000 0.000000 0.000000 0.000000
delay 0.02606, dispersion 0.00003
offset -28765.655310

11 Apr 06:46:51 ntpdate[1217]: no server suitable for synchronization found

  

出現 strata too high ,則可能是ntp服務版本高於4.2導致
ntpq -c version 可以查看ntp服務版本
解決辦法:在/etc/ntp.conf加入
server 127.127.1.0 fudge
127.127.1.0 stratum 8

NTP服務器的部署