In my company's infrastructure there are 5 data centers in remote locations.
In each remote location, there's a pair of servers which hold DNS and NTP services and are configured on each one of the servers in that location to get DNS and NTP calls from these two servers.
All servers are CentOS 6.x machines.
There's a motivation to create redundancy between these two servers in terms of DNS and NTP.
The DNS part is covered and I only have problem with NTP.
What is the correct method to make sure that when one NTP server fails, the second/rest of the servers will continue serving the clients just like nothing happened?
I've Google'ed about it and found a RedHat solution to set one of the servers as primary (by configuring it in the clients as "true") but in-case the "true" (primary) server fails... then it fails and clients wouldn't be getting NTP updates from it, so it's not a pure redundant solution.
I wanted to know if anyone had any experience with configuring such a solution?
Edit #1:
For a test of MadHatter's answer I've done the following:
- I've stopped NTPd on the server which is configured as "preferred" on each one of the NTP clients.
- I'm waiting for the NTP client to stop working against this server and start working against it's partner NTPd server.
- I'm running
ntpq -p
on the client to see the change. This is the output ofntpq -p
:
[root@ams2proxy10 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
10.X.X.38 .INIT. 16 u - 128 0 0.000 0.000 0.000
*10.X.X.39 131.211.8.244 2 u 2 64 377 0.123 0.104 0.220
What is "as in ntpq" ? which command shall I run please?
Edit #2: The output of as:
[root@ams2proxy10 ~]# ntpq
ntpq> as
ind assid status conf reach auth condition last_event cnt
===========================================================
1 64638 8011 yes no none reject mobilize 1
2 64639 963a yes yes none sys.peer sys_peer 3
ntpq>
The output of pe:
ntpq> pe
remote refid st t when poll reach delay offset jitter
==============================================================================
10.X.X.38 .INIT. 16 u - 512 0 0.000 0.000 0.000
*10.X.X.39 131.211.8.244 2 u 36 64 377 0.147 0.031 18874.7
ntpq>