Синхронизация времени по NTP Сравнение версий

Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Следующая версия
Предыдущая версия
wiki:руководство_по_ubuntu_server:сеть:ntp [2012/05/20 11:43]
создано
wiki:руководство_по_ubuntu_server:сеть:ntp [2015/02/15 11:40] (текущий)
[Настройка]
Строка 8: Строка 8:
 =====Синхронизация времени по NTP===== =====Синхронизация времени по NTP=====
  
-NTP is a TCP/IP protocol for synchronising time over a networkBasically a client requests the current time from a server, and uses it to set its own clock.+NTP - это протокол синхронизации времени по сетиПо существу клиенты запрашивают текущее время на сервере и используют его для установки своих собственных часов.
  
-Behind this simple description,​ there is a lot of complexity ​there are tiers of NTP serverswith the tier one NTP servers connected to atomic clocksand tier two and three servers spreading the load of actually handling requests across the InternetAlso the client software is a lot more complex than you might think it has to factor out communication delaysand adjust the time in a way that does not upset all the other processes that run on the serverBut luckily all that complexity is hidden from you!+За этим простым описанием скрывается много сложностей ​существуют уровни ​NTP серверовгде первый уровень подключен к атомным часама второй и третий уровни серверов распределяют на себя нагрузку по актуальным запросам из интернетаКроме того клиентское приложение сложнее,​ чем вы можете подумать ​оно компенсирует задержки соединения и регулирует время таким образом,​ чтобы не навредить другим процессамзапущенным на сервереНо к счастью вся эта сложность скрыта от вас!
  
-Ubuntu ​uses ntpdate ​and ntpd.+Ubuntu ​использует ​ntpdate ​и ntpd.
  
-    ​ntpdate +====ntpdate====
-    ntpd +
-    Installation +
-    Configuration +
-    View status +
-    References+
  
-ntpdate+Ubuntu стандартно устанавливается с ntpdate ​и будет запускать его при каждой загрузке один раз для установки времени по NTP серверу Ubuntu. 
 +<​code>​ntpdate -s ntp.ubuntu.com</​code>​
  
-Ubuntu comes with ntpdate as standard, and will run it once at boot time to set up your time according to Ubuntu'​s NTP server.+====ntpd====
  
-ntpdate -s ntp.ubuntu.com+Сервис NTP ntpd вычисляет уход ваших системных часов и постоянно подправляет их, благодаря чему не происходит сильных изменений,​ что может приводить к непоследовательности в журналахЦеной этому небольшое расходование мощности процессора и оперативной памяти,​ но для современного сервера это несущественно.
  
-ntpd+====Установка====
  
-The ntp daemon ​ntpd calculates the drift of your system clock and continuously adjusts it, so there are no large corrections that could lead to inconsistent logs for instance. The cost is a little processing power and memory, but for a modern server this is negligible. +Для установки ​ntpd из терминала введите:​ 
-Installation+<​code>​sudo apt-get install ntp</​code>​
  
-To install ntpd, from a terminal prompt enter:+====Настройка====
  
-sudo apt-get install ntp +Отредактируйте ​/​etc/​ntp.conf ​для добавления/удаления серверовПо умолчанию эти сервера такие
- +<​code>​# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
-Configuration +
- +
-Edit /​etc/​ntp.conf ​to add/remove server linesBy default these servers are configured+
- +
-# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board+
 # on 2011-02-08 (LP: #104525). See http://​www.pool.ntp.org/​join.html for # on 2011-02-08 (LP: #104525). See http://​www.pool.ntp.org/​join.html for
 # more information. # more information.
Строка 46: Строка 37:
 server 1.ubuntu.pool.ntp.org server 1.ubuntu.pool.ntp.org
 server 2.ubuntu.pool.ntp.org server 2.ubuntu.pool.ntp.org
-server 3.ubuntu.pool.ntp.org+server 3.ubuntu.pool.ntp.org</​code>​
  
-After changing the config file you have to reload the ntpd:+После изменений конфигурационного файла вам надо перезапустить ​ntpd: 
 +<​code>​sudo service ntp restart</​code>​
  
-sudo /​etc/​init.d/​ntp reload+====Просмотр статуса====
  
-View status +Используйте ​ntpq для просмотра дополнительной информации
- +<​code>​# sudo ntpq -p
-Use ntpq to see to see more info+
- +
-# sudo ntpq -p+
      ​remote ​          ​refid ​     st t when poll reach   ​delay ​  ​offset ​ jitter      ​remote ​          ​refid ​     st t when poll reach   ​delay ​  ​offset ​ jitter
 ============================================================================== ==============================================================================
Строка 63: Строка 52:
 *145.253.66.170 ​ .DCFa. ​          1 u   ​10 ​  ​64 ​ 377   ​83.607 ​ -30.159 ​ 68.343 *145.253.66.170 ​ .DCFa. ​          1 u   ​10 ​  ​64 ​ 377   ​83.607 ​ -30.159 ​ 68.343
 +stratum2-3.NTP. 129.70.130.70 ​   2 u    5   ​64 ​ 357   ​68.795 ​ -68.168 104.612 +stratum2-3.NTP. 129.70.130.70 ​   2 u    5   ​64 ​ 357   ​68.795 ​ -68.168 104.612
-+europium.canoni 193.79.237.14 ​   2 u   ​63 ​  ​64 ​ 337   ​81.534 ​ -67.968 ​ 92.792 ++europium.canoni 193.79.237.14 ​   2 u   ​63 ​  ​64 ​ 337   ​81.534 ​ -67.968 ​ 92.792</code>
- +
-References +
- +
-    See the Ubuntu Time wiki page for more information. +
- +
-    ntp.org, home of the Network Time Protocol project +
- +
-Time Synchronisation with NTP +
- +
-NTP is a TCP/IP protocol for synchronising time over a network. Basically a client requests the current time from a server, and uses it to set its own clock. +
- +
-Behind this simple description,​ there is a lot of complexity - there are tiers of NTP servers, with the tier one NTP servers connected to atomic clocks, and tier two and three servers spreading the load of actually handling requests across the Internet. Also the client software is a lot more complex than you might think - it has to factor out communication delays, and adjust the time in a way that does not upset all the other processes that run on the server. But luckily all that complexity is hidden from you! +
- +
-Ubuntu uses ntpdate and ntpd. +
- +
-    ntpdate +
-    ntpd +
-    Installation +
-    Configuration +
-    View status +
-    References +
- +
-ntpdate +
- +
-Ubuntu comes with ntpdate as standard, and will run it once at boot time to set up your time according to Ubuntu'​s NTP server. +
- +
-ntpdate -s ntp.ubuntu.com +
- +
-ntpd +
- +
-The ntp daemon ntpd calculates the drift of your system clock and continuously adjusts it, so there are no large corrections that could lead to inconsistent logs for instance. The cost is a little processing power and memory, but for a modern server this is negligible. +
-Installation +
- +
-To install ntpd, from a terminal prompt enter: +
- +
-sudo apt-get install ntp +
- +
-Configuration +
- +
-Edit /​etc/​ntp.conf to add/remove server lines. By default these servers are configured:​ +
- +
-# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board +
-# on 2011-02-08 (LP: #104525). See http://​www.pool.ntp.org/​join.html for +
-# more information. +
-server 0.ubuntu.pool.ntp.org +
-server 1.ubuntu.pool.ntp.org +
-server 2.ubuntu.pool.ntp.org +
-server 3.ubuntu.pool.ntp.org +
- +
-After changing the config file you have to reload the ntpd: +
- +
-sudo /​etc/​init.d/​ntp reload +
- +
-View status +
- +
-Use ntpq to see to see more info: +
- +
-# sudo ntpq -p +
-     ​remote ​          ​refid ​     st t when poll reach   ​delay ​  ​offset ​ jitter +
-============================================================================== +
-+stratum2-2.NTP. 129.70.130.70 ​   2 u    5   ​64 ​ 377   ​68.461 ​ -44.274 110.334 +
-+ntp2.m-online.n 212.18.1.106 ​    2 u    5   ​64 ​ 377   ​54.629 ​ -27.318 ​ 78.882 +
-*145.253.66.170 ​ .DCFa. ​          1 u   ​10 ​  ​64 ​ 377   ​83.607 ​ -30.159 ​ 68.343 +
-+stratum2-3.NTP. 129.70.130.70 ​   2 u    5   ​64 ​ 357   ​68.795 ​ -68.168 104.612 +
-+europium.canoni 193.79.237.14 ​   2 u   ​63 ​  ​64 ​ 337   ​81.534 ​ -67.968 ​ 92.792 +
- +
-References+
  
-    See the Ubuntu Time wiki page for more information.+====Ссылки====
  
-    ​ntp.org, home of the Network Time Protocol project+  -- Смотрите страницу энциклопедии [[https://​help.ubuntu.com/​community/​UbuntuTime|Ubuntu Time]] для дополнительной информации. 
 +  -- [[http://​www.ntp.org/​|Домашняя страница проекта Проткола синхронизации времени ntp.org]]
  
 ---- ----