LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-22-2011, 06:14 AM   #1
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Rep: Reputation: 15
NTP time difference


Dear All,

I am facing any issue with synchronizing server (CentOS 5.5 64bit) time with NTP server.I am executing command ntpdate 192.168.31.2 192.168.223.2 through crontab each minute. I have few other servers with same configuration on centos distribution. Neither Time match with servers themselves nor with the NTP server. Can anybody give me clue how to fix that?

Any help would be greatly appreciated.
 
Old 04-22-2011, 06:24 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,734

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
What are the time differences?
Running ntp is a better method since it will compensate for clock drift whereas ntpdate does not.
 
Old 04-22-2011, 06:24 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

I don't see why you have ntpdate executing every minute. If you have NTP configured correctly and have connection to a NTP pool (or dedicated time server in your network) then it get's synchronized by the NTP daemon itself. Execute this command and post output:
Code:
ntpq -p
as root.

Kind regards,

Eric
 
Old 04-22-2011, 06:33 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,734

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
In addition, ntpdate will fail to update if ntp is currently running.
 
1 members found this post helpful.
Old 04-22-2011, 06:42 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by michaelk View Post
In addition, ntpdate will fail to update if ntp is currently running.
Hi,

Correctly, thanks for pointing that out. Forgot to mention it.

Kind regards,

Eric
 
Old 04-22-2011, 09:01 AM   #6
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Original Poster
Rep: Reputation: 15
Dear EricTRA

# ntpq -p
ntpq: read: Connection refused
 
Old 04-22-2011, 09:05 AM   #7
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Original Poster
Rep: Reputation: 15
Dear michaelk,

Can you please let me know if any tutorial is available on the web which explains /etc/ntp.conf file.

Thanks for your help.
 
Old 04-22-2011, 09:36 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,734

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
Quote:
Originally Posted by zaeem View Post
Dear EricTRA

# ntpq -p
ntpq: read: Connection refused
Indicates ntp is not running.

Hopefully these links will help.
http://publib.boulder.ibm.com/infoce...s/ntp.conf.htm
https://wiki.archlinux.org/index.php...rotocol_daemon
 
Old 04-22-2011, 09:38 AM   #9
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by zaeem View Post
Dear EricTRA

# ntpq -p
ntpq: read: Connection refused
Hi,

As pointed out by michaelk, this indicates that NTP is not running. Check if you have it installed (rpm -q ntp) and if not install it using yum (yum install ntp).

Kind regards,

Eric
 
Old 04-24-2011, 04:37 AM   #10
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Original Poster
Rep: Reputation: 15
Dear Guys,

Thanks for your kind support. I've setup NTP on my server. I really appreciate your help.
 
Old 04-24-2011, 04:42 AM   #11
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

You're welcome. Glad you've got it solved. Have fun with Linux.

Kind regards,

Eric
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTP time sync with windows 2000 AD time csghosh Linux - Enterprise 7 02-24-2012 03:46 PM
NTP can't use its local time as its time reference ! mahdit Linux - Server 1 07-23-2010 09:07 AM
NTP Server giving central time instead of eastern time wjleon Linux - Networking 3 11-01-2007 04:04 PM
debian: Get time from ntp (network time protocol) servers checkmate3001 LinuxQuestions.org Member Success Stories 0 09-30-2007 06:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration