Currently, I am trying config 2 servers for NTP service

But my device already send request to 2 servers at the same time. How can I do to send request to the primary server first and if it is unsuccessful then send request to the secondary server?
I have never seen a NTP client do that. They send the request to all servers in the list and lock on to the one with best quality. The only way to make it shift is if the first locked on server fails or get bad quality, then the client will move to something better. But once synced that shift can take a very long time (the client clock usually need to get out of sync before a shift will occur, until that happens it will only wait for better times).
1 Like
So for operational use you simply specify all the servers you want and it will take care of it.
For testing use you can manipulate the server in use so it gets a higher stratum number that the backup server. For example set the time manually or make it use the RTC. Then the client should shift server sooner or later.
1 Like