Score:0

Which server will ntpd daemon prefer for time synchronization if we have multiple servers in ntp.conf file

cn flag

I read that ntp uses all the servers for time synchronization. It got me one question. Suppose I am having multiple servers in the ntp.conf file and time gap is also more than 1 day. I have not specified prefer keyword also in the ntp.conf file.

server.1 <ip>
server.2 <ip>
server.3 <ip>
server.4 <ip> 

If I ran ntpd with -g option then which server will ntp daemon prefer for filling the large time gap?

Score:4
cn flag

I read that ntp use all the servers for time synchronization.

Yes. Use at least 4 where feasible.

A better performing one is picked as the system peer, according to the selection algorithm. Including when ntpd starts, based on the first few timestamps received from all the peers.

In both startup or ongoing operation, NTP estimates what "NTP time" is. The ntpd -g option allows an infinite step, only once, in case the system clock is very wrong. VM resumed and time not corrected, failed or missing real time clock hardware, that kind of thing.

I have not specified prefer keyword also in the ntp.conf file.

Do not use the prefer keyword. The algorithms are good at estimating time keeping performance. Collect data to prove the hypothesis that you can pick a better peer, if you want to use prefer.

vivek avatar
cn flag
Thank you for the answer. My question is when I am using `ntpd -g` then with which server it will sync the time from the conf file. Does ntpd -g also uses selection algorithm for time sync or it just set the clock with any one of the server from the conf file
Paul Gear avatar
cn flag
`ntpd -g` always uses the selection algorithm, unless you configure it with an insufficient number of peers.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.