我们有两个VLAN,每个VLAN都有一个服务器,为其相应的VLAN提供DHCP、DNS和NTP。这3台服务器从本地NTP服务器上花费时间。以下是每个VLAN上NTP客户端和服务器的配置以及每个设置的问题:
VLAN 1:
NTP服务器(科学Linux 7.3)
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
logfile /var/log/ntp.log
driftfile /var/lib/ntp/drift
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
restrict 127.0.0.1
restrict xx.xx.xx.xx mask XX.XX.XX.XX nomodify notrapNTP客户端(科学Linux 7.3)
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server yy.yy.yy.yy # added by /sbin/dhclient-script尽管有正确的时区,此服务器始终向前移动3小时。
VLAN 2:
NTP服务器(科学Linux 6.4)
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
logfile /var/log/ntp.log
server 127.1.1.0 # local clock
fudge 127.127.1.0
driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict xx.xx.xx.xx mask XX.XX.XX.XX nomodify notrapNTP客户端(科学Linux 6.4)
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server yy.yy.yy.yy # added by /sbin/dhclient-script在这里我不能改变时区。它应该是EET,但是不管/etc/localtime链接值如何,它始终是EEST。
我已确保:
iptables -F)ntpd守护进程正在运行并启用(chckonfig on)chronyd的时间服务,它阻止ntpd启动。所以我禁用了它(失去了它的源代码:( ) )。在设置这些服务之后,我们将它们与本地NTP同步一次。通过对每个服务器上的DHCP配置,我们拥有了option ntp-servers xx.xx.xx.xx;,因此NTP信息是通过DHCP分布的。我尝试将本地NTP服务器的地址添加到服务器的/etc/ntp.conf中,但问题仍然存在。
注意,所有服务器都是通过VMWare ESXi虚拟化的。
发布于 2018-03-28 06:56:21
因此,经过与这些服务器的斗争,问题已经得到解决。以下是详细信息:
ntpd,并在客户端维护ntpd时使用了chronyd。从chronyd 7.X开始,似乎CentOS将是受支持的NTP守护进程。chronyd配置只需要/etc/chrony.conf中的server xx.xx.xx.xx prefer iburst和allow yy.yy.yy.yy/ZZtzdata 这里的新版本,然后将/etc/localtime链接到相应的时区,在我的例子中是Asia/Amman我发现了一些陷阱:
no server suitable for synchronization found,运行ntpdate,然后启动ntpd,解决了CentOS 6.4客户机上的可怕错误ntpd。restrict 127.0.0.1改为restrict localhosthttps://unix.stackexchange.com/questions/433604
复制相似问题