Description:
Install ntp
# In ubuntu
apt-get install ntp
#In centos
yum install ntp
Setup ntp server
#Edit server configuration
sudo vim /etc/ntp.conf
====
#Replace the {jp} to the country or replace the whole ntp server url
pool 0.{jp}.pool.ntp.org iburst
pool 1.{jp}.pool.ntp.org iburst
pool 2.{jp}.pool.ntp.org iburst
pool 3.{jp}.pool.ntp.org iburst
====
#Restart server
sudo service ntp status
Verify
#Install ntpstat
sudo apt-get install ntpstat
#Check ntp status
ntpstat
#synchronised to NTP server (133.243.238.243) at stratum 2
# time correct to within 19 ms
# polling server every 64 s