Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with the amazon ec2's clock drift?

We have a couple of ec2 instances on amazon, and we used amazon AIM Linux to set up. The instance type is m1.medium.

Everything is going well until this week.

We found from log file that there would be a huge clock drift happened suddenly, and sometimes there has a 5-minutes discrepancy。

I would like to ask if anyone else encounter this problem? How to deal with it?

like image 459
user2028644 Avatar asked Jan 31 '13 10:01

user2028644


People also ask

How does AWS sync clocks?

Amazon Time Sync is used by EC2 instances and other AWS services. It uses a fleet of redundant satellite-connected and atomic clocks in each Region to deliver time derived from these highly accurate reference clocks. This service is provided at no additional charge.

How do I change the timezone on my EC2 instance Windows?

After verifying the policy setting, you can change the time zone from the Command Prompt window. Run a Command Prompt window as Administrator. Enter time or date in the Command Prompt window, then select OK. Enter the new time or date at the prompt.

What does AWS inspector do?

Amazon Inspector is an automated security assessment service that helps improve the security and compliance of applications deployed on AWS. Amazon Inspector automatically assesses applications for exposure, vulnerabilities, and deviations from best practices.

How do I change my AWS timezone?

On the AWS Elemental Server web interface, go to the Settings page and choose General. In Timezone, choose your required time zone. Choose Update.


2 Answers

Time drift can occur due to over utilization of your instances resources. I would encourage you to check you cloudwatch CPU graphs to try identify if your CPU was being over utilized.

If you are running amazon linux AMI, NTP is installed by default.

To verify if NTP is running run

sudo service ntpd status

If it is not installed you can run the following to install it:

sudo yum install ntp

If NTPD is running and your clock time is off I would try to restart it and see if it synchs with the NTP servers your have setup. You can also add more NTP servers by editing the /etc/ntp.conf file. Just search for NTP servers to find ones to add.

like image 199
Ciaran Avatar answered Oct 07 '22 16:10

Ciaran


Yes, best not to trust the system clock. Just install and configure NTP.

like image 27
chrskly Avatar answered Oct 07 '22 17:10

chrskly