修改同步服务器的配置文件/etc/ntp.conf ,删除所有的内容,添加

restrict default nomodify
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 8

重启ntpd

/etc/init.d/ntpd restart

等待ntp服务器自身同步完成

watch ntpq -p

ntpd配置时间同步服务器

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

配置文件方式

服务器端配置

restrict default nomodify
server  127.127.1.0
fudge   127.127.1.0 stratum 8

客户端配置

driftfile /var/lib/ntp/drift
server 192.168.8.102
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys

/etc/sysconfig/ntpd

添加

SYNC_HWCLOCK=yes

多台ntp的情况

客户端配置

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)

restrict default nomodify
server  127.127.1.0
fudge   127.127.1.0
stratum 5

备份ntp配置

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日

相关文章:

  • 2022-12-23
  • 2021-10-30
  • 2022-01-09
  • 2021-12-22
  • 2021-12-09
  • 2021-12-23
  • 2021-12-09
  • 2021-12-09
猜你喜欢
  • 2022-02-15
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
  • 2021-06-25
相关资源
相似解决方案