How to configure ntp for Aerospike
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.
Ubuntu and Debian systems
sudo apt install ntp
Centos and RHEL systems
yum -y install ntp
Edit config file with local time servers:
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:
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.
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.