The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.
How to configure ntp for Aerospike
Context
Aerospike recommends synchronized time across nodes in a cluster in order to make sure objects expiration is handled consistently. Also time synchronization is required when using Cross datacenter replication to ensure proper replication of expirable data. In addition, log analysis and error debugging is less error prone when server clocks are aligned. Consider configuring NTP to start automatically on distributions that do not enable NTP by default.
Enabling NTP
Ubuntu and Debian systems
sudo apt install ntp
Centos and RHEL systems
yum -y install ntp
Edit config file with local time servers:
vi /etc/ntp.conf
Or use ntpdate to configure using centos.pool.ntp.org or your local time servers:
sudo ntpd start ntp
sudo ntpd enable ntp
sudo ntp status ntp
sudo ntpdate -u -s 0.centos.pool.ntp.org 1.centos.pool.ntp.org 2.centos.pool.ntp.org
Reload the service:
sudo systemctl reload ntp.service
or
sudo systemctl restart ntp
Check the ntpd status:
sudo ntpq -p
or
sudo timedatectl
Also, consider update the hardware clock:
hwclock -w
Notes
Reference
Details
NTPD can adjust your clock in slow increments if it’s off, clock skewing. The idea behind that is that slow steps won’t cause issues with software timers, strange gaps in log files etc. The maximum slew rate possible is limited to 500 parts-per-million (PPM) by the Unix kernel. As a result, the clock can take 2000s for each second the clock is outside the acceptable range.
According to the manual page ntpd
won’t work if your clock is more then 1000 seconds off.
Since slewing the clock to adjust it by 1000 seconds will take at least 3 weeks and during that time all date/timestamps are still off, that might not seem too unreasonable.
The ntpdate
command has a -b
switch to simply adjust the time without slewing. This is useful in cases where the the local system clock deviates too much from the “correct” time.
Keywords
ntp,ntpd,time sync,xdr
Timestamp
October 2020