Wrong time on my Ubuntu Amazon EC2 instances
EC2 instances should take their time from the host but there are occasional problems with that. If you configure ntp correctly it should resolve this.
Some more instructions here: http://support.rightscale.com/06-FAQs/FAQ_0025_-_Can_I_use_Network_Time_Protocol_(NTP)_on_my_RightScale_servers%3F
Amazon provides Amazon Time Sync Service which eliminates the time drift you are experiencing. The overall steps to take on each EC2 instance are:
- Remove NTP using
sudo apt-get remove ntp
- Install Chrony using
sudo apt install chrony
- use
sudo vim /etc/chrony/chrony.conf
to edit the file to includeserver 169.254.169.123 prefer iburst
- Restart Chrony using
sudo /etc/init.d/chrony restart
- Verify Chrony is using the correct IP using
chronyc sources -v
and verifying that the output includes '^* 169.254.169.123' - Identify the best timezone to use with
sudo timedatectl list-timezones
- Update the timezone from UTC using the path from the previous step, such as
sudo timedatectl set-timezone America/Chicago