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:

  1. Remove NTP using sudo apt-get remove ntp
  2. Install Chrony using sudo apt install chrony
  3. use sudo vim /etc/chrony/chrony.conf to edit the file to include server 169.254.169.123 prefer iburst
  4. Restart Chrony using sudo /etc/init.d/chrony restart
  5. Verify Chrony is using the correct IP using chronyc sources -v and verifying that the output includes '^* 169.254.169.123'
  6. Identify the best timezone to use with sudo timedatectl list-timezones
  7. Update the timezone from UTC using the path from the previous step, such as sudo timedatectl set-timezone America/Chicago