Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


NTP keeps crashing
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

NTP keeps crashing

mpkossenmpkossen Member

At the office we have a couple of servers running Xen. The Dom0s have NTP running and the DomUs have not. Every now and then NTP crashes, which makes the DomUs' time go out of sync, which in turn can have some nasty consequences.

My colleague has already spent a lot of time on this and hasn't found a solution yet. Our current workaround is restarting NTP on the Dom0 and then running rdate from the CLI on the DomUs for that node to get the time back in sync.

I'm curios if anybody here has had these problems as well and if there is a solution? Right now we have Nagios monitor NTP on the Dom0s so we get texted when they're out of sync. It's not an ideal situation, though.

Thanks in advance for any help!

Comments

  • MaouniqueMaounique Host Rep, Veteran

    I suppose you can write your own script to fetch time and set the clock. Or you can run rdate on the dom0.

  • RalliasRallias Member
    edited May 2014

    */4 * * * * ntpdate pool.0.ntp.org 2>&1 >/dev/null

    Thanked by 1VPN
  • wojonswojons Member

    @Rallias said:
    */4 * * * * ntpdate pool.0.ntp.org 2>&1 >/dev/null

    That can work but there is some delay in it i like to use supervisor since it will restart the process right away. So anytime ntp crashes it just springs back to luck.

    @mpkossen what steps have been taken for example was there anything in syslog or dmesg, have u started ntp in the forground and logged its output including erros?

  • MaouniqueMaounique Host Rep, Veteran

    wojons said: have u started ntp in the forground and logged its output including erros?

    A screen would do. However, if something keeps crashing, it might mean something. I suppose he checked for the amplification bug and all the usual suspects.
    NTP is pretty simple, I never saw it crashing in any of my servers, not even when I had bad disks or memory. Something else gave way and the kernel was in panic first.

  • RalliasRallias Member

    wojons said: That can work but there is some delay in it

    2 things.

    1. If your clock skews more than a second within an hour, you've got bigger problems than a crashy NTPd.

    2. The crontab entry does oneshot syncs.

  • XSXXSX Member, Host Rep
    edited May 2014

    update you /etc/sysconfig/clock and /etc/localtime

    echo "xen.independent_wallclock=1">> /etc/sysctl.conf && sysctl -p
    service ntpd stop
    ntpdate cn.pool.ntp.org
    echo "ntpdate us.pool.ntp.org">>/etc/rc.local 
    date
Sign In or Register to comment.