NTPサーバの構築
スポンサーリンク
Linuxについての記事です。
システムの時刻を日本標準時刻と同期させるためにNTPサーバを構築します。
ここではCentOSにNTPサーバを構築していきます。
概要
Network Time Protocol(ネットワーク・タイム・プロトコル)ネットワークに接続されている機器の持つ時計を正しい時刻に同期するための通信プロトコルです。
コンピュータにある時計をインターネット通信で正しく調整するための通信規格のことです。
NTPサーバのインストール
# yum install ntp
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
base | 3.7 kB 00:00
base/primary_db | 4.4 MB 00:02
extras | 3.4 kB 00:00
extras/primary_db | 18 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 3.2 MB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ntp.x86_64 0:4.2.4p8-3.el6.centos will be installed
--> Processing Dependency: ntpdate = 4.2.4p8-3.el6.centos for package: ntp-4.2.4p8-3.el6.centos.x86_64
--> Processing Dependency: libedit.so.0()(64bit) for package: ntp-4.2.4p8-3.el6.centos.x86_64
--> Running transaction check
---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be installed
---> Package ntpdate.x86_64 0:4.2.4p8-3.el6.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
ntp x86_64 4.2.4p8-3.el6.centos base 444 k
Installing for dependencies:
libedit x86_64 2.11-4.20080712cvs.1.el6 base 74 k
ntpdate x86_64 4.2.4p8-3.el6.centos base 58 k
Transaction Summary
================================================================================
Install 3 Package(s)
Total download size: 576 k
Installed size: 1.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm | 74 kB 00:00
(2/3): ntp-4.2.4p8-3.el6.centos.x86_64.rpm | 444 kB 00:00
(3/3): ntpdate-4.2.4p8-3.el6.centos.x86_64.rpm | 58 kB 00:00
--------------------------------------------------------------------------------
Total 1.9 MB/s | 576 kB 00:00
警告: rpmts_HdrFromFdno: ヘッダ V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key)
Package: centos-release-6-4.el6.centos.10.x86_64 (@anaconda-CentOS-201303020151.x86_64/6.4)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ntpdate-4.2.4p8-3.el6.centos.x86_64 1/3
Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64 2/3
Installing : ntp-4.2.4p8-3.el6.centos.x86_64 3/3
Verifying : libedit-2.11-4.20080712cvs.1.el6.x86_64 1/3
Verifying : ntp-4.2.4p8-3.el6.centos.x86_64 2/3
Verifying : ntpdate-4.2.4p8-3.el6.centos.x86_64 3/3
Installed:
ntp.x86_64 0:4.2.4p8-3.el6.centos
Dependency Installed:
libedit.x86_64 0:2.11-4.20080712cvs.1.el6
ntpdate.x86_64 0:4.2.4p8-3.el6.centos
Complete!
NTPサーバの起動と自動起動の設定
# /etc/init.d/ntpd start
# chkconfig ntpd on
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
laika.paina.jp .STEP. 16 u 201 64 0 0.000 0.000 0.000
ntp7.vps.net 133.243.238.243 2 u 7 64 1 6.899 -2.561 0.000
fnttkyo043241.t 165.246.43.176 3 u 17 64 1 12.385 2.294 0.000
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+laika.paina.jp 131.113.192.40 2 u 9 64 77 7.067 8.887 5.922
*ntp7.vps.net 133.243.238.243 2 u 31 64 77 6.048 8.374 8.020
+fnttkyo043241.t 165.246.43.176 3 u 35 64 77 10.581 9.717 5.284
スポンサーリンク