Greets!
Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so?
thx. Mike
The default settings should be pretty good. I believe it uses pool.ntp.orgby default, which is a big list of ntp servers of stratum 2 (and possibly 3?) servers. Running the ntpd service is probably the best way to do it. 'service ntpd start' should be all that is need. If you clock is more than a minute or two out to begin with, you may need to issue a 'ntpd -q -g'.
On 3/31/07, Mike centos@silverservers.com wrote:
Greets!
Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so?
thx. Mike
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Gary Richardson wrote:
The default settings should be pretty good. I believe it uses pool.ntp.orgby default, which is a big list of ntp servers of stratum 2 (and possibly 3?) servers. Running the ntpd service is probably the best way to do it. 'service ntpd start' should be all that is need. If you clock is more than a minute or two out to begin with, you may need to issue a 'ntpd -q -g'.
And, speaking from experience, check your firewall.
Running /etc/init.d/ntpdate on bootup is good.
That seems a little too easy - yet there it is running now.
chkconfig --level 3 ntpd on
I guess some things just work right out of the box. thx!
Gary Richardson wrote:
The default settings should be pretty good. I believe it uses pool.ntp.org http://pool.ntp.org by default, which is a big list of ntp servers of stratum 2 (and possibly 3?) servers. Running the ntpd service is probably the best way to do it. 'service ntpd start' should be all that is need. If you clock is more than a minute or two out to begin with, you may need to issue a 'ntpd -q -g'.
On 3/31/07, *Mike* <centos@silverservers.com mailto:centos@silverservers.com> wrote:
Greets! Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so? thx. Mike
Mike wrote:
Greets!
Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so?
CentOS 4.4 standard NTP install /etc/ntp.conf is set to use the following NTP servers:
server 0.pool.ntp.org server 1.pool.ntp.org server 2.pool.ntp.org
These are sorta special in that they are backed by many different servers and DNS queries expand them for you (do a "dig 0.pool.ntp.org a" to see what I mean). Each time you do a DNS query to one of those addresses you will get a different set of servers returned.
So to simplify what I'm saying you just need to:
# yum install ntp (if not already installed) # chkconfig ntpd on # service ntpd start
Peter Gross wrote:
Mike wrote:
Greets!
Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so?
CentOS 4.4 standard NTP install /etc/ntp.conf is set to use the following NTP servers:
server 0.pool.ntp.org server 1.pool.ntp.org server 2.pool.ntp.org
I do wish it would prefer the time server offered by DHCP:-( I'd rather sync one computer over the Internet, and the rest off my local network.
Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so?
CentOS 4.4 standard NTP install /etc/ntp.conf is set to use the following NTP servers:
server 0.pool.ntp.org server 1.pool.ntp.org server 2.pool.ntp.org
I do wish it would prefer the time server offered by DHCP:-( I'd rather sync one computer over the Internet, and the rest off my local network.
I'm not a NTP expert but...........
Keeping time in sync within fractions of a second is reasonable. Google and test a few severs, NTP has a host of tools that will tell you which servers are responding the best, adjust what servers you use accordingly.
NTP runs as a daemon and will automatically keep track of time drift and adjust itself as to how often it needs to poll the servers. If your system keeps good time it may only poll once an hour.
One server can be set to sync via the internet (firewall/gateway server) and the rest of the local network syncs to this box, you only need one server to sync over the internet and then the local network (linux & windows system) sync to that server.
On Apr 2, 2007, at 11:32 AM, Ken Godee wrote:
Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so?
I do wish it would prefer the time server offered by DHCP:-( I'd rather sync one computer over the Internet, and the rest off my local network.
how large is your local network? arguably you should be using at least two, and ideally three, timeservers on the local network; ntp works ok with only one source of time, but times will converge much more quickly with multiple sources of time.
don't run 'ntpdate' from a cron job; that defeats the whole purpose of running ntpd.
-steve
-- If this were played upon a stage now, I could condemn it as an improbable fiction. - Fabian, Twelfth Night, III,v
Steve Huff wrote:
On Apr 2, 2007, at 11:32 AM, Ken Godee wrote:
Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so?
I do wish it would prefer the time server offered by DHCP:-( I'd rather sync one computer over the Internet, and the rest off my local network.
how large is your local network? arguably you should be using at least two, and ideally three, timeservers on the local network; ntp works ok with only one source of time, but times will converge much more quickly with multiple sources of time.
don't run 'ntpdate' from a cron job; that defeats the whole purpose of running ntpd.
and this won't work if ntpd is running ("socket already in use" or something similar).
On Mon, Apr 02, 2007 at 11:34:44PM +0200, mouss said:
Steve Huff wrote:
don't run 'ntpdate' from a cron job; that defeats the whole purpose of running ntpd.
and this won't work if ntpd is running ("socket already in use" or something similar).
This is what the -u parameter is for. See the man page. But yes - running ntpdate when you are also running ntpd is silly.
ntpdate is useful in system startup to force the clock right before ntpd starts in case your bios clock is wrong. I use it in kickstart and then set the bios clock right after.
Steve Huff wrote:
On Apr 2, 2007, at 11:32 AM, Ken Godee wrote:
Ok. I'm looking at a client that needs to keep their server time close as reasonably possible (within a minute) of the actual time of day. I've installed the RPM for NTP and I'm looking for tips on what the simplest setup should be, ie: What server(s) should I be using for sync? Should I just run it from a cron every 20 minutes or so?
I do wish it would prefer the time server offered by DHCP:-( I'd rather sync one computer over the Internet, and the rest off my local network.
how large is your local network? arguably you should be using at least
The size has nothing to do with my preference; I could as easily tell them all to sync against pool.ntp.org, time.apple.com, time.ubuntulinux.org or any other.
There are good choices to suit all tastes, and a standard centralised means of configuring one's preference. RH just ignores it.
two, and ideally three, timeservers on the local network; ntp works ok with only one source of time, but times will converge much more quickly with multiple sources of time.
don't run 'ntpdate' from a cron job; that defeats the whole purpose of running ntpd.
Sometimes ntpdate is appropriate; a standalone peecee on dialup might run it on every successful connection to the Internet. Even if it means shutting down ntpd for a few seconds.
Steve Huff wrote:
how large is your local network? arguably you should be using at least two, and ideally three, timeservers on the local network; ntp works ok with only one source of time, but times will converge much more quickly with multiple sources of time.
Unless something has changed recently, ntp doesn't believe in multiple sources of time. It will pick the one it thinks is best and ignore the others, and it adjusts the clock fractional seconds at at time so you don't miss any timer intervals.
Les Mikesell wrote:
Unless something has changed recently, ntp doesn't believe in multiple sources of time. It will pick the one it thinks is best and ignore the
Oh, ntp does indeed believe in multiple sources. Sure, only one is preferred and will be used as timesource, but it is constantly evaluating the other servers for lag/jitter and change primary source if it feels like it.
You should have an odd number of servers.. 1, 3, 5, ... and so on.
On Apr 3, 2007, at 4:21 AM, Morten Torstensen wrote:
Les Mikesell wrote:
Unless something has changed recently, ntp doesn't believe in multiple sources of time. It will pick the one it thinks is best and ignore the
Oh, ntp does indeed believe in multiple sources. Sure, only one is preferred and will be used as timesource, but it is constantly evaluating the other servers for lag/jitter and change primary source if it feels like it.
You should have an odd number of servers.. 1, 3, 5, ... and so on.
it appears that Morten, Les, and i are all correct. :)
from "Notes on setting up a NTP subnet" (http://www.eecis.udel.edu/ ~mills/ntp/html/notes.html):
--- begin paste --- Each client in the synchronization subnet (which may also be a server for other, higher stratum clients) chooses exactly one of the available servers to synchronize to, usually from among the lowest stratum servers it has access to. This is, however, not always an optimal configuration, for indeed NTP operates under another premise as well, that each server's time should be viewed with a certain amount of distrust. NTP really prefers to have access to several sources of lower stratum time (at least three) since it can then apply an agreement algorithm to detect insanity on the part of any one of these. Normally, when all servers are in agreement, NTP will choose the best of these, where "best" is defined in terms of lowest stratum, closest (in terms of network delay) and claimed precision, along with several other considerations. The implication is that, while one should aim to provide each client with three or more sources of lower stratum time, several of these will only be providing backup service and may be of lesser quality in terms of network delay and stratum (i.e., a same-stratum peer which receives time from lower stratum sources the local server doesn't access directly can also provide good backup service). --- end paste ---
in a nutshell: while a NTP client is only using one timeserver at any given time for synchronization, the client prefers to be able to select among several different time sources and will switch preferred servers as it sees fit. thus, while it is perfectly possible to make NTP work with a single source of time, you are likely to see better performance if you configure several sources.
the reason i asked about network size is that it seems a bit silly to configure three time servers for a small home network of, say, four hosts - you may as well just make every host on your network an NTP peer, and point them all at each other and at some external time source. of course, this scheme doesn't scale very well.
-steve
-- If this were played upon a stage now, I could condemn it as an improbable fiction. - Fabian, Twelfth Night, III,v
Steve Huff wrote:
On Apr 3, 2007, at 4:21 AM, Morten Torstensen wrote:
the reason i asked about network size is that it seems a bit silly to configure three time servers for a small home network of, say, four hosts - you may as well just make every host on your network an NTP peer, and point them all at each other and at some external time source. of course, this scheme doesn't scale very well.
I would expect any Linux box (including my Linksys wrt54G) to be able to satisfy the timekeeping requirements of an entire class C network and more. There can't be all that much time traffic else nobody would do anything useful.