3

We have an Amazon EC2 CentOS 7.5 instance whose clock, at boot, is always 35 days late. Yes, you read it correctly. That's a hell of a drift.

[root@myec2 ~]# ntpd -gqn
ntpd: time set +2937270.012860s

Where does the machine fetches the current (bogus) date from? Perhaps somewhere from the instance metadata URI http://169.254.169.254/latest/meta-data/ ?

2
  • There is nothing in the metadata service about time. There's an internal NTP endpoint at 169.254.169.123 but it wouldn't be wrong. When you say "at boot," are you referring to after a stop/start of the instance via the EC2 console/API, or something else? Jun 5, 2018 at 13:22
  • Any reboot of the server, for instance via init 6.
    – dr_
    Jun 5, 2018 at 14:01

1 Answer 1

4

There is a decent chance the answer is nowhere or nowhere it can reach. You should look at the Amazon Time Sync Service. This seems to be the recommended method now, because NTP also requires making sure every instance can reach the internet that needs NTP and the VPC is configured correctly for NTP traffic; which may or may not be something you want.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .