5
1

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 3 years have passed since last update.

IBM CloudのVPC環境で時刻同期(Private Service Endpointを利用)

Posted at

#1. はじめに

VPC環境ではデフォルトではNTPは構成されていない。

[root@syasuda-tok1-vpc1 ~]# timedatectl
      Local time: Tue 2020-11-03 17:32:33 JST
  Universal time: Tue 2020-11-03 08:32:33 UTC
        RTC time: Tue 2020-11-03 08:32:46
       Time zone: Asia/Tokyo (JST, +0900)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

IBM Cloud docsには、Private NWからアクセス可能なNTP endpoint情報として161.26.0.6が提供されているため、この情報を利用してNTPを構成する。今回はCentOS7+chronyを利用した。

#2. chronyの導入と設定

chronyの導入
# yum install -y chrony

/etc/chrony.confはとりあえず接続先情報さえ変えたらそのままでも動くので、(細かいカスタマイズは行うことなくデフォルトの設定をそのまま採用し)、今回は接続先のみを変更。

/etc/chrony.confの設定変更
# vi /etc/chrony.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
↓
server 161.26.0.6 iburst
chronydの起動
# systemctl start chronyd

#3. 動作確認

NTPが有効になった。
# timedatectl
      Local time: Tue 2020-11-03 17:41:13 JST
  Universal time: Tue 2020-11-03 08:41:13 UTC
        RTC time: Tue 2020-11-03 08:41:12
       Time zone: Asia/Tokyo (JST, +0900)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
# chronyc tracking
Reference ID    : A11A0006 (mirrors.adn.networklayer.com)
Stratum         : 4
Ref time (UTC)  : Tue Nov 03 08:39:36 2020
System time     : 0.000035592 seconds fast of NTP time
Last offset     : +0.000036951 seconds
RMS offset      : 0.000421925 seconds
Frequency       : 19.302 ppm slow
Residual freq   : +0.012 ppm
Skew            : 0.823 ppm
Root delay      : 0.145885363 seconds
Root dispersion : 0.048914578 seconds
Update interval : 64.2 seconds
Leap status     : Normal
アスタリスク(*)が付いている行が実際に同期しているNTPサーバ
# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* mirrors.adn.networklayer>     3   6   177    34    +15us[  +52us] +/-  125ms
5
1
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
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?