Configure time synchronization

Configure all containers in an MKE cluster to regularly synchronize with a Network Time Protocol (NTP) server, to ensure consistency between all containers in the cluster and to circumvent unexpected behavior that can lead to poor performance.

  1. Install NTP on every machine in your cluster:

    sudo apt-get update && sudo apt-get install ntp ntpdate
    sudo yum install ntp ntpdate
    sudo systemctl start ntpd
    sudo systemctl enable ntpd
    sudo systemctl status ntpd
    sudo ntpdate -u -s
    sudo systemctl restart ntpd
    sudo zypper ref && zypper install ntp

    In addition to installing NTP, the command sequence starts ntpd, a daemon that periodically syncs the machine clock to a central server.

  2. Sync the machine clocks:

    sudo ntpdate
  3. Verify that the time of each machine is in sync with the NTP servers:

    sudo ntpq -p

    Example output, which illustrates how much the machine clock is out of sync with the NTP servers:

         remote           refid      st t when poll reach   delay   offset  jitter
    ==============================================================================    2 u   24   64    1   60.391  4623378   0.004
     time-a.timefreq .ACTS.           1 u   23   64    1   51.849  4623377   0.004
     helium.constant     2 u   22   64    1   71.946  4623379   0.004  .GPS.            1 u   21   64    1   59.576  4623379   0.004
     golem.canonical    2 u   20   64    1  145.356  4623378   0.004