Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm working on getting some servers running in the EC2 environment and I'm noticing some errors with ntpd trying to sync (using CentOS).

I was reading on this site and the impression I get is that I don't need to run ntpd since EC2 is Xen and the host takes care of the time for the virtual servers.
http://support.ntp.org/bin/view/Support/KnownOsIssues

Is this accurate or do I need to figure out how to get around the error I'm having?
cap_set_proc() failed to drop root privileges
It looks like it involves building a new kernel and other stuff I'd rather not do if I don't have to.

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

You shouldn't need to. The clock of your EC2 instance will be synchronized to the Xen Dom0. You can verify this by checking that the contents of /proc/sys/xen/independent_wallclock are 0.

share|improve this answer
1  
I could not find anything like this. Is this information still applicable? –  Kariem Mar 28 '11 at 11:15
5  
@Kariem: Newer kernels have /sys/devices/system/clocksource/clocksource0/current_clocksource, see the comment below. –  intgr Apr 13 '11 at 10:38
1  
For me /sys/devices/system/clocksource/clocksource0/current_clocksource contains "xen" but still time on the machine is off by a couple of minutes. –  akostadinov Jan 22 '13 at 17:32
add comment

Yes, you need to run ntpd.

My clock was 18.5 seconds off on an EC2 micro instance (running Ubuntu UEC Maverick) with 5 days uptime.

After shutting down and starting again, it was back to normal, so there seems to be some kind of drift.

This is despite /sys/devices/system/clocksource/clocksource0/current_clocksource saying xen, by the way. I'm not sure why it's not working.

Installing the ntp package has solved the problem for me. The clock stays accurate, and there's nothing suspicious in the syslog that might indicate a conflict with Xen's clock synchronization. (It uses ntp.ubuntu.com as its server. I'm not sure if there's an NTP server in the AWS network that I could use instead, but the Ubuntu server will do nicely for now.)

share|improve this answer
6  
I just noticed a several minute drift in one of my servers in which /sys/devices/system/clocksource/clocksource0/current_clocksource is set to xen as well –  jberryman Jul 7 '11 at 15:39
2  
independent_wallclock sysctl was not accepted upstream for the pvops kernels. Newer kernels (perhaps 2.6.24 and above) behave as independent wallclock == 1. So the only solution is to use NTP. –  akostadinov Jan 23 '13 at 19:32
2  
This post has a comment from (supposedly) an AWS staff member saying that EC2 does not sync clocks, so you should run NTP. forums.aws.amazon.com/thread.jspa?messageID=364749 –  Dan Pritts Feb 15 '13 at 19:56
    
...also, the ntp.org pool has some amazon specific servers: forums.aws.amazon.com/message.jspa?messageID=312682 – Dan Pritts Feb 15 at 22:21 –  Dan Pritts Mar 20 '13 at 21:55
add comment

We run Linux ec2 instances from small to extra large and I just did a check to make sure they were in sync.

All servers were running the ntp daemon connecting to amazon specific pools.

server 0.amazon.pool.ntp.org iburst
server 1.amazon.pool.ntp.org iburst
server 2.amazon.pool.ntp.org iburst
server 3.amazon.pool.ntp.org iburst

This may not have been the case before bug I just wanted to make sure whoever stumbles across this in the future has up to date information.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.