修改同步服务器的配置文件/etc/ntp.conf ,删除所有的内容,添加
1 2 3
   | restrict default nomodify server  127.127.1.0      fudge   127.127.1.0 stratum 8
 
  | 
 
重启ntpd
1
   | /etc/init.d/ntpd restart
 
  | 
 
等待ntp服务器自身同步完成

观察这个reach需要超过17
否则其他机器ntpdate同步的时候会报错

配置文件方式
服务器端配置
1 2 3
   | restrict default nomodify server  127.127.1.0 fudge   127.127.1.0 stratum 8
 
  | 
 
客户端配置
1 2 3 4
   | driftfile /var/lib/ntp/drift server 192.168.8.102 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys
 
  | 
 
/etc/sysconfig/ntpd
添加
多台ntp的情况
客户端配置
1 2 3 4 5
   | driftfile /var/lib/ntp/drift server 192.168.8.102 prefer server 192.168.8.101 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys
 
  | 
 
主ntp配置(可以改成上级ntp)
1 2 3 4
   | restrict default nomodify server  127.127.1.0 fudge   127.127.1.0 stratum 5
 
  | 
 
备份ntp配置
1 2 3 4 5
   | driftfile /var/lib/ntp/drift server 192.168.8.102 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys stratum 6
 
  | 
 
更新历史
| why | 
when | 
| 创建 | 
2013年08月06日 | 
| 更新 | 
2019年12月9日 |