NTP对分布式时间同步有多好? [英] How good is NTP for distributed time synchronization?

查看:328
本文介绍了NTP对分布式时间同步有多好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NTP如何准确地保持一组服务器的时间同步?



我编写的服务需要一组服务器作为服务器)同步到第二级粒度。我想知道NTP是否是最好的东西,还是有更好的东西?



我应该在其中一个上运行ntp服务器,并让其他人使用作为他们的来源?任何其他推荐/ NTP的恐怖故事?



所有服务器都是linux。



更新:服务级别:



我想要一个服务器是准确的UTC(二级,而不是微秒级等),我想所有其他服务器是相同的作为一个服务器,不管它的准确的UTC是否(事件由这个服务器从多个位置以不同的间隔接收,我要求所有这些事件在相同的相对ts。不,我不能主服务器TS在它们进入时的事件,因为这将需要存储偏移(当事件实际发生发生时和当它被记录时,这需要大量额外的工作),以及



我目前设置了一个服务器作为层2时间服务器,在ntp.conf中使用一些startum 1 GPS源作为服务器,在其他服务器上,我已将此服务器设置为ntp.conf中的唯一服务器。



我希望这将是足够的。
谢谢!

解决方案

首先,您可以查看维基百科NTP网页。



基本上,首先)说明你想要的服务级别是什么。你需要准确的UTC吗?到什么容忍?



或者你只需​​要系统之间的精确同步?



我们正在谈论多少台机器,它们是否在地理位置上分布?



一些选项:




  • 准确时间:至少将一台服务器设置为第2层,并且至少引用3个第1层服务器。如果你有很多服务器,做多个;


  • 精确同步:设置NTP对等体。


  • 准确的时间和地理分布:多个层2服务器,如上所述,每个簇有一个近;他们可以在第2层进行对等以改进投票。




我不认为有什么比NTP更好的

更新另一个问题提到了PTP精确时间协议(IEEE 1588)这对于精确同步非常理想,但取决于多播。



此外,值得考虑获取GPS时间源。


How accurate is NTP for keeping a set of servers time synchronized?

I'm writing a service which requires a set of servers (some acting as clients, some as servers) synchronized to second level granularity. I'm wondering if NTP is the best thing to use, or if there's something better?

Should I run a ntp server on one of them, and have the others use that as their source? Any other recommendations/horror stories with NTP?

All the servers are linux.

Update: Service levels:

I'd like the one server to be accurate UTC(second level, not microsecond or such), and I'd like all the other servers to be the same ts as that one server, regardless of whether its accurate UTC or not (events are received by this one server from multiple locations at various intervals, I require all those events to be at the same "relative" ts. No, I can't have the main server TS the events as they come in, because that'll require storing an offset (when the event actually happened and when it was logged, which requires a whole lot of extra work), and that complicates matters needlessly.

I've currently set up one server as stratum 2 timeserver, using some startum 1 GPS sources as servers in ntp.conf, on the other servers, I've set this server to be the sole server in ntp.conf.

I hope this will be enough. Thank you!

解决方案

First off, you might have a look at the Wikipedia NTP page.

Basically, to start with (I preach this regularly) state what the service levels you want might be. Do you need accurate UTC? To what tolerance? That is, do you really need to know what time it is?

Or do you simply want precise synchronization among the systems?

How many machines are we talking about, and are they geographically distributed?

Some options:

  • accurate time: Set up at least one server as stratum 2, and have it reference at least 3 stratum 1 servers. If you have lots of servers, make that more than one; obviously you get more reliability by having no single point of failure.

  • precise synchronization: set up NTP peers.

  • accurate time and geographical distribution: more than one stratum 2 server, as above, with one "near" each cluster; they can peer at stratum 2 to improve the voting.

I don't think there's anything well known better than NTP that's available.

Update Another question mentions the PTP precision time protocol (IEEE 1588) This is excellent for precise synchronization, but depends on multicast.

Also, it's worth considering getting a GPS time source.

这篇关于NTP对分布式时间同步有多好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆