LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-03-2009, 07:21 PM   #1
scucci
Member
 
Registered: Sep 2009
Posts: 31

Rep: Reputation: 15
Configure a server to use NTP


Hello,

I just noticed that we have a few servers that are badly drifting out of time. I'd like to have them sync up to public time server to get their time. My questions are:

1. How do you setup a server to query another NTP server. Do I edit the /etc/ntp.conf file?

2. Not sure how this works, but can you set up a priority to have servers fall back to another time server if the original one isn't reachable?

3. Currently I have the below configured in my ntp.conf, can someone please help me understand this?

server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10

4. Also what is a driftfile?

Last edited by scucci; 12-03-2009 at 08:50 PM.
 
Old 12-03-2009, 07:45 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by scucci View Post

1. How do you setup a server to query another NTP server. Do I edit the /etc/ntp.conf file?
Yes. And then, depending on how far they're out of whack,
either run an "ntpdate server" manually, and then start the
service, or just start the service. Also make sure it (ntpd)
will be started on each boot (how depends on your distro).

Quote:
Originally Posted by scucci View Post
2. Not sure how this works, but can you set up a priority to have servers fall back to another time server if the original one isn't reachable?
Yes. Same file. Just give the machines different "strata".


Cheers,
Tink
 
Old 12-04-2009, 01:05 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by scucci View Post
Hello,

I just noticed that we have a few servers that are badly drifting out of time. I'd like to have them sync up to public time server to get their time. My questions are:

1. How do you setup a server to query another NTP server. Do I edit the /etc/ntp.conf file?

2. Not sure how this works, but can you set up a priority to have servers fall back to another time server if the original one isn't reachable?

3. Currently I have the below configured in my ntp.conf, can someone please help me understand this?

server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10

4. Also what is a driftfile?
  1. Yes. Good servers to use are listed at http://www.pool.ntp.org/en/. The names listed are, where possible (usually the case), virtual names that resolve to a "round robin" of servers. Depending on which country you are in you probably need only the name for your country. If the country does not have many NTP servers, list the continent's name, too. Thus, being In India, I configure /etc/ntp.conf like this
    Code:
    # Time sources
    server in.pool.ntp.org
    server asia.pool.ntp.org
    server 127.127.1.0
    fudge 127.127.1.0 stratum 10
  2. This is addressed by the pool.ntp.org name being a round robin and listing the continent's name after the country's name in case none of the country's NTP servers are available.
  3. AFAIK, the first line allows ntpd to use the hardware clock; the second makes the hardware clock a last resort (most public NTP servers are stratum 2 or 3, meaning they get their time directly from a first quality server or from a stratum 2 server. Thus "stratum 10" is a way down the preference order.
  4. AFAIK, a driftfile is used to record how the local clock has drifted from time as served by NTP. NTP is internally very complex and subtle with a lot of thought and experience in its design to provide a best possible service; knowing how the local clock behaves is taken into account, for example to correct the clock if no time servers can be contacted or to determine how often time servers need to be consulted.
ntpd is designed to minimise resource usage so does not often check time servers. After configuring it you need to wait (say 10 to 30 minutes) before checking the logs to see if it is working. This can mean that the relevant messages are widely spaced in the logs. Here's a command that works on Slackware 13.0 to search the logs. It is to be run with /var/log as the current directory; it may need to be modified for other distros
Code:
grep -hE '(ntpd.*synch)|(flushing export cache)|(ACPI: FACP CFEE3040)' messages syslog | grep -v LOCAL | sort
 
  


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 drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 07:35 PM
Configure NTP server ayush1440 Linux - Server 2 03-16-2009 02:38 PM
How to configure SAMBA and NIS and NTP server on Fedora 7 OS poswer Linux - Server 2 08-04-2008 03:53 AM
How to configure ntp server ? gaurav gupta Linux - Software 2 09-25-2007 12:12 AM
NTP cannot use server, NTP -d can jerryvapps Linux - Newbie 0 07-28-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:20 AM.

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