Sto cercando di configurare NTP su una rete locale che non ha (e non lo farà mai) una connessione Internet. La priorità principale è che le macchine sulla rete siano sincronizzate tra loro, anche se l'ora in cui sono sincronizzate non è precisa al 100%.
È inoltre necessario utilizzare una gerarchia NTP per replicare l'installazione di un sistema distribuito. Quello che voglio fare è avere una gerarchia di macchine come questa:
Moon (Main Server running Windows) (10.1.3.10)
|____Earth (Linux x64 client) (10.1.3.1)
|____Mars (Linux x64 client) (10.1.3.2)
|____Saturn (Linux x64 client) (10.1.3.3)
|____RackCard23 (Linux x64 client and server to the two machines below) (10.1.3.23)
|___RackCard21 (Linux x64 client) (10.1.4.21)
|___RackCard22 (Linux x64 client) (10.1.4.22)
Si noti che le RackCard hanno due porte Ethernet, una connessa alla rete 10.1.3.xe una sulla rete 10.1.4.x. RackCard23, che si sincronizza con il server master Moon, lo farà sulla rete 10.1.3.xe RackCard22 / 23 si collegherà a RackCard23 sulla rete 10.1.4.x. Questo perché non voglio che RackCards22 / 23 lasci la loro rete per sincronizzare l'ora e perché replica un sistema distribuito finale.
Finora sono riuscito a ottenere tutto ciò che dovrebbe sincronizzando Off Moon per la sincronizzazione corretta (inclusa RackCard23).
Ma ho difficoltà a far sincronizzare RackCard22 e 23 con RackCard23.
[root@RackCard23]# cat /etc/ntp.conf
# NTP Deamon Configuration File "ntp.conf"
# Created on 27/04/2010
# Original backed-up as "ntp.conf.backup"
server 10.1.3.10 iburst minpoll 4 maxpoll 4 prefer #This is what we want to happen
fudge 127.127.1.0 stratum 2 #Not sure about these two lines, was trying to force it to be a stratum 2 server
fudge 127.127.0.1 stratum 2
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /var/lib/ntp/drift
restrict 10.1.3.10 mask 255.255.255.255 nomodify notrap noquery
#Attempt to get to act as an NTP Server
broadcast 10.1.4.255
restrict 10.1.3.21 mask 255.255.255.255 nomodify notrap
restrict 10.1.4.21 mask 255.255.255.255 nomodify notrap
Questo è l'output di ntptrace:
[rootRackCard23]# /usr/sbin/ntptrace
localhost.localdomain: stratum 16, offset 0.000000, synch distance 0.000030
Come puoi vedere la macchina si sta segnalando come un server stratum 16, nonostante sia stata sincronizzata con un server "stratum 1" (Moon):
[root@RackCard23 awd]# /usr/sbin/ntpdate -d 10.1.3.10
21 Jun 13:55:09 ntpdate[19410]: ntpdate 4.2.2p1@1.1570-o Tue May 19 13:57:56 UTC 2009 (1)
Looking for host 10.1.3.10 and service ntp
host found : 10.1.3.10
transmit(10.1.3.10)
receive(10.1.3.10)
transmit(10.1.3.10)
receive(10.1.3.10)
transmit(10.1.3.10)
receive(10.1.3.10)
transmit(10.1.3.10)
receive(10.1.3.10)
transmit(10.1.3.10)
server 10.1.3.10, port 123
stratum 1, precision -6, leap 00, trust 000
refid [LOCL], delay 0.04135, dispersion 0.00383
transmitted 4, in filter 4
reference time: cfc99402.e010624d Mon, Jun 21 2010 8:32:18.875
originate timestamp: cfc9dfad.48000000 Mon, Jun 21 2010 13:55:09.281
transmit timestamp: cfc9dfad.47e27179 Mon, Jun 21 2010 13:55:09.280
filter delay: 0.04155 0.04155 0.04137 0.04135
0.00000 0.00000 0.00000 0.00000
filter offset: -0.01448 0.000781 0.000537 0.000394
0.000000 0.000000 0.000000 0.000000
delay 0.04135, dispersion 0.00383
offset 0.000394
21 Jun 13:55:09 ntpdate[19410]: adjust time server 10.1.3.10 offset 0.000394 sec
La configurazione dei client (RackCard21 / 22) è simile alla seguente:
[root@RackCard21]# cat /etc/ntp.conf
# NTP Deamon Configuration File "ntp.conf"
# Created on 27/04/2010
# Original backed-up as "ntp.conf.backup"
server 10.1.4.23 iburst minpoll 4 maxpoll 4 prefer
server 127.127.1.0
fudge 127.127.1.0 stratum 10
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /var/lib/ntp/drift
# restrict 127.0.0.1
restrict None mask 255.255.255.255 nomodify notrap noquery
E ntptrace dà questo:
[root@RackCard21]# /usr/sbin/ntpdate -d 10.1.4.23
21 Jun 14:04:34 ntpdate[14381]: ntpdate 4.2.2p1@1.1570-o Tue May 19 13:57:56 UTC 2009 (1)
Looking for host 10.1.4.23 and service ntp
host found : 10.1.4.23
transmit(10.1.4.23)
receive(10.1.4.23)
transmit(10.1.4.23)
receive(10.1.4.23)
transmit(10.1.4.23)
receive(10.1.4.23)
transmit(10.1.4.23)
receive(10.1.4.23)
transmit(10.1.4.23)
10.1.4.23: Server dropped: strata too high
server 10.1.4.23, port 123
stratum 16, precision -20, leap 11, trust 000
refid [10.1.4.23], delay 0.02568, dispersion 0.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Thu, Feb 7 2036 6:28:16.000
originate timestamp: cfc9dfef.12b79516 Mon, Jun 21 2010 13:56:15.073
transmit timestamp: cfc9e1e2.aeae7d56 Mon, Jun 21 2010 14:04:34.682
filter delay: 0.02573 0.02571 0.02568 0.02568
0.00000 0.00000 0.00000 0.00000
filter offset: -499.609 -499.609 -499.609 -499.609
0.000000 0.000000 0.000000 0.000000
delay 0.02568, dispersion 0.00000
offset -499.609286
21 Jun 14:04:34 ntpdate[14381]: no server suitable for synchronization found
Quindi non riesce a trovare un server adatto perché il server che sto cercando di utilizzare sta segnalando che si tratta di un server stratum 16 (che credo significhi non sincronizzato). Questo nonostante il fatto che sia sincronizzato.
Quindi devo in qualche modo rendere RackCard23 uno strato superiore (idealmente strato 2). Come faccio a farlo?
Qualsiasi aiuto è molto apprezzato in quanto ho cercato di farlo funzionare per giorni ormai!
MODIFICARE:
Ciao Christopher,
Ho riavviato ntpd, sì;)
Tutte le scatole di Linux eseguono CentOS 5.4.
Questo è l'output dei comandi che hai suggerito. Innanzitutto dal server:
[root@RackCard23]# /usr/sbin/ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
10.1.3.10 .INIT. 16 u - 16 0 0.000 0.000 0.000
10.1.4.255 .BCST. 16 u - 64 0 0.000 0.000 0.001
[root@RackCard23]# /usr/sbin/ntpdc -c monlist
remote address port local address count m ver code avgint lstint
===============================================================================
localhost.localdomain 34566 127.0.0.1 1 7 2 0 0 0
10.1.4.21 123 10.1.4.23 5 3 4 180 5 1
10.1.4.22 123 10.1.4.23 7 3 4 0 2 2
E poi dal client:
[root@RackCard21]# /usr/sbin/ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
10.1.4.23 .INIT. 16 u 10 16 0 0.000 0.000 0.000
LOCAL(0) .LOCL. 10 l 44 64 1 0.000 0.000 0.001