4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NTP クライアント Chrony

Last updated at Posted at 2016-12-28

概要

安定した常時接続が前提の NTP デーモン (ntpd) に代わり、モバイルや仮想環境などの不安定な接続環境に対応した Chrony 1 が RHEL 7 (CentOS 7) からデフォルトインストールされるようになった。 2

インストール

CentOS 7.2.1511 以前では minimal では Chrony がインストールされないので以下の通りインストールする。

yum install chrony
sed -i.org /etc/chrony.conf -e '/^server/ s/^/#/'
systemctl enable chronyd && systemctl start chronyd

公開 NTP サーバー

公開 NTP サーバー

強制的な時刻同期

chronyc -a makestep
出力例
200 OK
200 OK

chrony トラッキングの確認

chronyc tracking
出力例
Reference ID    : 157.7.208.12 (timpany.srv.jre655.com)
Stratum         : 3
Ref time (UTC)  : Mon Dec 12 11:29:59 2016
System time     : 0.000663179 seconds fast of NTP time
Last offset     : +0.001061445 seconds
RMS offset      : 0.002669210 seconds
Frequency       : 59.962 ppm slow
Residual freq   : +0.574 ppm
Skew            : 20.360 ppm
Root delay      : 0.009656 seconds
Root dispersion : 0.005571 seconds
Update interval : 65.2 seconds
Leap status     : Normal

chrony ソースの確認

chronyc sources -v
出力例
210 Number of sources = 4

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^- y.ns.gin.ntt.net              2   6    17    23  +3115us[+3115us] +/-  298ms
^- v157-7-235-92.z1d6.static     2   6    17    22  -2315us[-2315us] +/-  104ms
^- hachi.paina.jp                2   6    17    23  -1007us[-1007us] +/-   34ms
^* ekg.netfort.gr.jp             2   6    17    23    -19us[-1443us] +/-   41ms

chrony ソースの統計情報の確認

chronyc sourcestats -v
出力例
210 Number of sources = 4
                             .- Number of sample points in measurement set.
                            /    .- Number of residual runs with same sign.
                           |    /    .- Length of measurement set (time).
                           |   |    /      .- Est. clock freq error (ppm).
                           |   |   |      /           .- Est. error in freq.
                           |   |   |     |           /         .- Est. offset.
                           |   |   |     |          |          |   On the -.
                           |   |   |     |          |          |   samples. \
                           |   |   |     |          |          |             |
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
timpany.srv.jre655.com      6   4   136     -1.911    122.287    -74us  2157us
x.ns.gin.ntt.net            6   5   135    +25.199    249.621  +3566us  3308us
v157-7-235-92.z1d6.static   6   5   136    +10.827    477.476  +1529us  6730us
li400-120.members.linode.   6   5   136    +46.856    427.178  +6431us  4876us
  1. https://access.redhat.com/documentation/ja-JP/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-Configuring_NTP_Using_the_chrony_Suite.html#sect-Choosing_between_NTP_daemon

  2. https://access.redhat.com/documentation/ja-JP/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Using_chrony.html#sect-Installing_chrony

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?