Network

NTP

You can synchronize HAProxy ALOHA to a Network Time Protocol (NTP) time server to enhance log accuracy and synchronize the date and time of all instances in a cluster.

The NTP service manages the Linux ntpdate(8) daemon on the HAProxy ALOHA appliance.

Synchronize the date and time regularly Jump to heading

To configure when and how HAProxy ALOHA synchronizes to an NTP server:

  1. In the Services tab, click ntp setup.

    NTP Setup

    The current configuration displays.

    service ntp force_sync no autostart
    service ntp force_sync no autostart
  2. Configure the ntp service.

    You can synchronize to an NTP server before starting the NTP daemon, bypass a firewall, or set how often HAProxy ALOHA synchronizes to a server.

    See the subsections below.

  3. Save the configuration, then restart the ntp service.

  4. In the Setup tab, click Save under Local Configuration to persist your changes after a reboot.

Set the time before starting the NTP daemon Jump to heading

In some cases, you may want to set the clock before starting the ntpdate daemon.

  1. Use the force_sync and the sync_servers directives as follows.

    Replace the IP address in the example with the IP address of the NTP server you want to synchronize to.

    If the NTP server is located beyond a firewall that blocks incoming traffic to privileged ports, use an unprivileged port through the unpriv_port directive. For example:

    service ntp force_sync sync_servers 129.6.15.28 unpriv_port
    service ntp force_sync sync_servers 129.6.15.28 unpriv_port

    Info

    • Specify the IP address of the NTP server, not its FQDN. HAProxy ALOHA does not perform DNS resolution for its internal system.
    • This may slow down the boot process.
  2. Once you have restarted the ntp service, check which actions took place in the console logs area in the Logs tab.

    text
    Nov 22 17:22:51 ALOHA1 user.info admin[2671]: ALOHA1# service 'ntp' 'restart'
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: # Stopping ntpd (pid 32527 according to /var/run/ntp.pid) ...
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: Waiting.
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: --> removing stale pid file ...
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: ==> stop ntpd Done.
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: # Starting ntp ...
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: Using ntpdate to sync with server(s) 129.6.15.28...
    Nov 22 17:22:57 ALOHA1 user.warn admin[2671]: /usr/sbin/ntpd -c /etc/ntp/ntp.conf -p /var/run/ntp.pid -k /etc/ntp/ntp.keys
    Nov 22 17:22:57 ALOHA1 user.notice admin[2671]: 22 Nov 17:22:57 ntpdate[4419]: adjust time server 129.6.15.28 offset 0.000236 sec
    Nov 22 17:22:57 ALOHA1 user.notice admin[2671]: ==> start ntp Done.
    text
    Nov 22 17:22:51 ALOHA1 user.info admin[2671]: ALOHA1# service 'ntp' 'restart'
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: # Stopping ntpd (pid 32527 according to /var/run/ntp.pid) ...
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: Waiting.
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: --> removing stale pid file ...
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: ==> stop ntpd Done.
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: # Starting ntp ...
    Nov 22 17:22:51 ALOHA1 user.notice admin[2671]: Using ntpdate to sync with server(s) 129.6.15.28...
    Nov 22 17:22:57 ALOHA1 user.warn admin[2671]: /usr/sbin/ntpd -c /etc/ntp/ntp.conf -p /var/run/ntp.pid -k /etc/ntp/ntp.keys
    Nov 22 17:22:57 ALOHA1 user.notice admin[2671]: 22 Nov 17:22:57 ntpdate[4419]: adjust time server 129.6.15.28 offset 0.000236 sec
    Nov 22 17:22:57 ALOHA1 user.notice admin[2671]: ==> start ntp Done.

Define other NTP servers used at runtime Jump to heading

By default, HAProxy ALOHA queries NTP servers from the France pool zone, https://www.ntppool.org/zone/fr, from the pool.ntp.org timeservers project.

To define other servers:

  1. In the Services tab, click the [advanced mode] link. Then edit the ntp service.

    NTP Edit

    The content of the /etc/ntp/ntp.conf NTP configuration file displays.

  2. Edit the file, add server lines, save the configuration, then restart the ntp service. Configure NTP servers using IP addresses, in case DNS resolvers have not been configured.

  3. Once you have restarted the ntp service, check which actions took place in the console logs area in the Logs tab.

    text
    Nov 22 16:46:18 ALOHA1 user.info admin[2671]: ALOHA1# service 'ntp' 'restart'
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: # Stopping ntpd (pid 29011 according to /var/run/ntp.pid) ...
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: Waiting.
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: --> removing stale pid file ...
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: ==> stop ntpd Done.
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: # Starting ntp ...
    Nov 22 16:46:18 ALOHA1 user.warn admin[2671]: /usr/sbin/ntpd -c /etc/ntp/ntp.conf -p /var/run/ntp.pid -k /etc/ntp/ntp.keys
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: ==> start ntp Done.
    text
    Nov 22 16:46:18 ALOHA1 user.info admin[2671]: ALOHA1# service 'ntp' 'restart'
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: # Stopping ntpd (pid 29011 according to /var/run/ntp.pid) ...
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: Waiting.
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: --> removing stale pid file ...
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: ==> stop ntpd Done.
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: # Starting ntp ...
    Nov 22 16:46:18 ALOHA1 user.warn admin[2671]: /usr/sbin/ntpd -c /etc/ntp/ntp.conf -p /var/run/ntp.pid -k /etc/ntp/ntp.keys
    Nov 22 16:46:18 ALOHA1 user.notice admin[2671]: ==> start ntp Done.

Set the time and date once Jump to heading

You can manually set the local time and date of your HAProxy ALOHA appliance by synchronizing once with an NTP server or by entering a value.

Caution

This procedure only sets the date and time once. For regularly synchronizing HAProxy ALOHA to an NTP server, configure the NTP service from the Services tab, as shown in the previous sections.

  1. In the Date area on the Setup tab, either:

    • Enter the IP address of an NTP server.
    • Manually enter a time and date.

    NTP Update

  2. Click Update to set the system clock.

  3. Check the updated system time in the Setup tab. The system information should reflect the update to the system time.

    You can also check the console logs area in the Logs tab.

    text
    Nov 19 15:09:11 ALOHA1 user.notice admin[2671]: 19 Nov 15:09:11 ntpdate[22876]: adjust time server 129.6.15.28 offset -0.000143 sec
    Nov 19 15:09:11 ALOHA1 user.info admin[2671]: ALOHA1# service 'system' 'date_to_hw'
    Nov 19 15:09:12 ALOHA1 user.notice admin[2671]: Saving system time to hardware clock (UTC)... Done.
    text
    Nov 19 15:09:11 ALOHA1 user.notice admin[2671]: 19 Nov 15:09:11 ntpdate[22876]: adjust time server 129.6.15.28 offset -0.000143 sec
    Nov 19 15:09:11 ALOHA1 user.info admin[2671]: ALOHA1# service 'system' 'date_to_hw'
    Nov 19 15:09:12 ALOHA1 user.notice admin[2671]: Saving system time to hardware clock (UTC)... Done.

Do you have any suggestions on how we can improve the content of this page?