My Server Time is WAY off

November 12th, 2009 § 0

Well, it was this morning.  I didn’t realize it until I went to schedule a blog post for 12 hours later and it published immediately. I was concerned and actually went to blame WordPress first (I’m really not sure why).  However, when I was looking at the time preferences in the General settings area of the site I noticed something really strange.  My timezone was correct, but the date WP was showing was way off. This meant that my CentOs5 server’s time was way off.

I did a little research and found an article called “Setting the time of your system“.  They gave me some good solutions on how to fix the issue, after reading it I was ready to go.  I tried a couple things in the order they said and found myself a little confused. So naturally, I started trying things till they worked.  This is not always the best solution, but I figured I could deal with a timing issue if I messed it up worse than it was.

For my CentOs 5 server I did the following, which actually worked and set the time perfectly.

First, I checked the date the server had, which turned out to be way off.

  1. # date
  2. Thu Nov 12 23:56:41 MST 2009

Then I looked to see if ntpd (the automatic time adjustment service) was running, it was.

  1. # service ntpd status
  2. ntpd (pid 12019) is running…

I tried ntpdate to reset the time on the server, but it complained about the socket being in use.

  1. # ntpdate 129.6.15.28
  2. 12 Nov 23:57:28 ntpdate[12045]: the NTP socket is in use, exiting

My solution was to stop ntpd and then run ntpdate again, which worked!

  1. # service ntpd stop
  2. Shutting down ntpd:                                        [  OK  ]
  3.  
  4. # ntpdate 129.6.15.28
  5. 12 Nov 07:25:10 ntpdate[12063]: step time server 129.6.15.28 offset -59562.023808 sec

A simple restart of the ntpd service and the time was correct!

  1. # service ntpd start
  2. Starting ntpd:                                             [  OK  ]
  3.  
  4. # date
  5. Thu Nov 12 07:25:20 MST 2009

So, the solution was to do the following steps:

  1. # service ntpd stop
  2. # ntpdate 129.6.15.28
  3. # service ntpd start
  4. #date

I added “date” on the end, because you want to verify that the time actually did reset. Best of Luck!

Tags: , , , , , , , , ,

Sphere: Related Content

Tagged: , , , , , , , , ,

§ Leave a Reply

What's this?

You are currently reading My Server Time is WAY off at Reinforce Media, LLC.

meta

FireStats icon Powered by FireStats