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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-03-2009, 08:21 PM
|
#1
|
Member
Registered: Sep 2009
Posts: 31
Rep:
|
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 09:50 PM.
|
|
|
12-03-2009, 08:45 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally Posted by scucci
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
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
|
|
|
12-04-2009, 02:05 AM
|
#3
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
Quote:
Originally Posted by scucci
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?
|
- 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
- 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.
- 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.
- 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
|
|
|
All times are GMT -5. The time now is 05:20 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|