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 daemon on the HAProxy ALOHA appliance.
See also
Synchronize the date and time regularly
You can configure when and how HAProxy ALOHA synchronizes to an NTP server.
-
In the Services tab, click ntp setup
.
The current configuration displays.
service ntp force_sync check_interval 60 no autostart
-
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.
Save the configuration, then restart
the ntp service.
Set the time before starting the NTP daemon
In some cases, you may want to set the clock before starting the ntpdate daemon.
-
Use the
force_sync
and thesync_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.service ntp force_sync sync_servers 129.6.15.28 unpriv_port
-
Once you have restarted the ntp service, check which actions took place in the console logs area in the Logs tab.
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.
Set how often HAProxy ALOHA synchronizes to an NTP server
By default, HAProxy ALOHA will synchronize to an NTP server every minute.
-
Specify another interval in seconds through the
check_interval
directive.service ntp check_interval 120
If set to 0 or lower, the default value is used.
-
Once you have restarted the ntp service, check which actions took place in the console logs area in the Logs tab.
Nov 22 16:20:02 ALOHA1 user.info admin[2671]: ALOHA1# service 'ntp' 'restart' Nov 22 16:20:02 ALOHA1 user.notice admin[2671]: # Stopping ntpd (pid 24501 according to /var/run/ntp.pid) ... Nov 22 16:20:02 ALOHA1 user.notice admin[2671]: Waiting. Nov 22 16:20:02 ALOHA1 user.notice admin[2671]: --> removing stale pid file ... Nov 22 16:20:02 ALOHA1 user.notice admin[2671]: ==> stop ntpd Done. Nov 22 16:20:02 ALOHA1 user.notice admin[2671]: # Starting ntp ... Nov 22 16:20:02 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:20:02 ALOHA1 user.notice admin[2671]: ==> start ntp Done.
Define other NTP servers used at runtime
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.
You can also define other servers.
-
In the Services tab, click the
[advanced mode]
link, then edit the ntp service.The content of the /etc/ntp/ntp.conf NTP configuration file displays.
Edit the file, add
server
lines, save the configuration, then restartthe ntp service.
-
Once you have restarted the ntp service, check which actions took place in the console logs area in the Logs tab.
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
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.
-
In the Date area on the Setup tab:
enter the IP address of an NTP server, or,
manually enter a time and date.
Click Update to set the system clock.
-
Check the updated system time in the Setup tab.
You can also check the console logs area in the Logs tab.
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.
Next up
VLAN