Centos-logo-light.svg
Centos-logo-light” by CentOS

CentOS minimalにはntpが入っていなかったので、インストール/時刻同期を行いました。

手順

  • ntpサーバのインストール
# yum install ntp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* epel: ftp.riken.jp
* extras: www.ftp.ne.jp
* updates: www.ftp.ne.jp
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ntp.x86_64 0:4.2.6p5-1.el6.centos will be installed
--> Processing Dependency: ntpdate = 4.2.6p5-1.el6.centos for package: ntp-4.2.6p5-1.el6.centos.x86_64
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-1.el6.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
Package Arch Version Repository Size
===================================================================================================================
Installing:
ntp x86_64 4.2.6p5-1.el6.centos base 592 k
Installing for dependencies:
ntpdate x86_64 4.2.6p5-1.el6.centos base 75 k

Transaction Summary
===================================================================================================================
Install 2 Package(s)

Total download size: 667 k
Installed size: 1.7 M
Is this ok [y/N]: y
  • ランレベルの確認
# chkconfig --list | grep ntp
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
  • 自動起動on
# chkconfig ntpd on
  • ランレベルの確認
# chkconfig ntp --list | grep ntp
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
  • デフォルトのntpサーバの確認
# grep ^server /etc/ntp.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
  • 時刻同期
# ntpdate 0.centos.pool.ntp.org
12 May 14:45:09 ntpdate[26045]: the NTP socket is in use, exiting
  • 時刻確認
# date
2014年 5月 12日 月曜日 14:45:12 JST
  • ntpサービス起動
# service ntpd start