2

I have four servers running ntpd daemons, how can I monitor their running status?

By the way, I am running ntpdate command with crontab.

user7916
  • 125
  • 7
aboutstudy
  • 957
  • 3
  • 10
  • 10

3 Answers3

4

Additionally, NTPDate is not a service/daemon. It's a one-time command tool that immediately synchronizes the software clock. It's packaged with NTP on some Linux distributions, but not necessarily all.

I would not recommend its use on a system that is running a database. Historically, many database products don't deal well with abrupt changes in system time.

Magellan
  • 4,431
  • 3
  • 29
  • 53
  • In some condition, such as the server was restart before the ntpd is running, should I run the commmand tool of ntpdate? – aboutstudy Feb 14 '12 at 02:46
  • I think you're looking at it backwards. I only recommend running ntpdate before any time-sensitive services (such as databases) start up during the boot process. I seem to recall that there were option to call ntpdate at NTPd service start for an initial time sync, but I can no longer find that reference. – Magellan Feb 14 '12 at 03:02
  • Although further research indicates that the ntpdate isn't as problematic as it used to be. I'd still recommend shutting down any databases before doing an ntpdate time sync. – Magellan Feb 14 '12 at 03:21
3

Note that the authors of ntp/ntpdate deprecate the use of ntpdate. The recommendation is to run ntpd to keep your clock continuously synced. The page where they explain why they deprecate it has lots of good information about how to use ntpd in a context where it is replacing ntpdate.

Once you have been running ntpd long enough to have a good drift file, there should be no reason to use ntpdate at all. As long as ntpd is properly configured (which the above page discusses, the important parts being that it is running with -g, and you have iburst for a good server), ntpd should be able to correct your clock quickly. If you need for some reason to wait for ntpd to get a good sync before doing something (like starting a service that needs the time to be correct), you can use the ntp-wait command.

stew
  • 9,263
  • 1
  • 28
  • 43
1

ntpq -p will show you the status of the NTP daemon, with information about which peers it's syncing with and its opinion on the hygiene habits (or clock accuracy, if you prefer) of each.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248