LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cross synchronization NTP not working (https://www.linuxquestions.org/questions/linux-newbie-8/cross-synchronization-ntp-not-working-913861/)

Vikonder 11-16-2011 10:54 AM

Cross synchronization NTP not working
 
Hi,

I have Red Hat 5.5 on 2 units (hub-omu1a, hub-omu1b)
Synchronization should be cross:

hub-omu1a ---> hub-omu1b
hub-omu1b ---> hub-omu1a

1. Configure /etc/ntp.conf (equal for each unit)
Code:

requestkey 1
controlkey 0
trustedkey 1
statsdir /var/ntp/ntpstats/
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
restrict default notrust notrap
restrict 10.9.16.100 mask 255.255.255.255 nomodify notrap
restrict 10.9.16.101 mask 255.255.255.255 nomodify notrap
filegen peerstats file peerstats  type day enable
filegen loopstats file loopstats  type day enable
filegen clockstats file clockstats type day enable
tos orphan 7
server hub-omu1b key 1
peer hub-omu1a key 1

2. Result of NTP synchronization:
Code:

[root@hub-omu1a /etc/init.d]# ntpq -p
    remote          refid      st t when poll reach  delay  offset  jitter
==============================================================================
*hub-omu1b      127.0.0.1        7 u  62  64  377    0.180  -0.038  0.042
 hub-omu1a      .INIT.          16 u    -  64    0    0.000    0.000  0.000
[root@hub-omu1a /etc/init.d]# ntpstat
synchronised to NTP server (10.9.15.58) at stratum 7
  time correct to within 10 ms
  polling server every 64 s

Code:

[root@hub-omu1b /etc/init.d]# ntpq -p
    remote          refid      st t when poll reach  delay  offset  jitter
==============================================================================
 hub-omu1a      10.9.15.58      7 u  23  64  77    0.236    0.008  0.013
 hub-omu1b      .INIT.          16 u    -  64    0    0.000    0.000  0.000
[root@hub-omu1b /etc/init.d]# ntpq -p
    remote          refid      st t when poll reach  delay  offset  jitter
==============================================================================
 hub-omu1a      10.9.15.58      7 u  26  64  77    0.236    0.008  0.013
 hub-omu1b      .INIT.          16 u    -  64    0    0.000    0.000  0.000
[root@hub-omu1b /etc/init.d]# ntpstat
synchronised to unspecified at stratum 7
  time correct to within 0 ms
  polling server every 64 s

What is incorrect to get really cross Synchronization???

thanks

tronayne 11-16-2011 01:18 PM

You may want to re-think what you're doing just a little -- let's say that you have a reference source, be that a radio clock, GPS, stratum 2 server somewhere electrically close to you, it might be useful to assign your hub-omu1a as your primary time server, serving time to your network (in this case hub-omu1b). If the two hubs are electrically close (as in connected to the same LAN), hub-omu1b will synchronize to hub-omu1a before it will ever synchronize to an outside time source and hub_omu1a has no reason whatsoever to synchronize to hub_omu1b (it's kind of like audio feedback doing that).

Your /etc/ntp.conf for hub-omu1a would use three servers (more is overkill, less isn't always useful), the first being a dedicated time source (if you have one; e.g., a radio clock or GPS), and two additional pool servers (or just three pool servers if you don't have a dedicated time source), something like this:
Code:

server  127.127.1.0    # local clock
fudge  127.127.1.0 stratum 10
server  0.us.pool.ntp.org
server  1.us.pool.ntp.org
server  2.us.pool.ntp.org

You need the local clock if the internet goes away (or your dedicated time source goes away) so that NTP can fall back on itself while there's an outage. You use the fudge line so that the local clock will not remain in use once the internet (time source) comes back on line.

You then want to serve time to hub-omu1b (or, for that matter to your entire LAN) from hub-omu1a) -- it's useful to assign fixed-IP addresses to your servers rather than relying on DHCP to not drop a lease. Your /etc/ntp.conf file on hub-omu1b would look like
Code:

server  127.127.1.0    # local clock
fudge  127.127.1.0 stratum 10
server  address_of_hub-oum1a or its name if you have it listed in /etc/hosts
server  0.us.pool.ntp.org
server  1.us.pool.ntp.org

Neither this or any other machine needs nor wants to feed back to the other and it is necessary to add the local clock, fudge plus the two pool servers lines for when hub-oum1a is unavailable and, of course, hub-oum1a needs to be configured to serve time. Keep in mind that if you have PCs hanging on your network, hum-oum1a will serve time to as well.

Might work better for you that way.

Hope this helps some.


All times are GMT -5. The time now is 10:43 PM.