CentOS6 / NTPdインストール
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
** NTPd で時刻を合わせる [#d669b1f3]
- ゲストOSは、どうやらUTC固定になっているのでxmlを弄って...
# vi /etc/libvirt/qemu/test.xml
<clock offset='utc'/>
↓
<clock offset='localtime'/>
# virsh define test.xml
ゲストOSの再起動
*** システムのタイムゾーンを確認(設定)する [#k52f5a3b]
- UTCになっている場合(日本時間じゃないー!)
$ date
Wed Aug 7 06:27:48 UTC 2013
- 東京に変更
# vi /etc/sysconfig/clock
ZONE="Asia/Tokyo"
UTC="false"
# source /etc/sysconfig/clock
- タイムゾーンファイルを上書きコピー
# cp -p /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
*** ホスト/ゲストOS両方で [#q45af487]
- /etc/ntp.conf の設定
# yum install ntp
# vi /etc/ntp.conf
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify not...
restrict 192.168.1.0 mask 255.255.255.0 nomodify notr...
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.n...
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
↓ 時刻同期先NTPサーバーを変更
server ntp.nict.jp # 日本標準時を提供しているNTPサー...
server ntp.jst.mfeed.ad.jp # 上記サーバーと直接同期し...
- NTPd起動
# ntpdate ntp.nict.jp
# /etc/rc.d/init.d/ntpd start
# chkconfig ntpd on
# chkconfig --list ntpd
- 同期確認
# ntpq -p
結果行の先頭に '*', '+' が付いていればok
終了行:
** NTPd で時刻を合わせる [#d669b1f3]
- ゲストOSは、どうやらUTC固定になっているのでxmlを弄って...
# vi /etc/libvirt/qemu/test.xml
<clock offset='utc'/>
↓
<clock offset='localtime'/>
# virsh define test.xml
ゲストOSの再起動
*** システムのタイムゾーンを確認(設定)する [#k52f5a3b]
- UTCになっている場合(日本時間じゃないー!)
$ date
Wed Aug 7 06:27:48 UTC 2013
- 東京に変更
# vi /etc/sysconfig/clock
ZONE="Asia/Tokyo"
UTC="false"
# source /etc/sysconfig/clock
- タイムゾーンファイルを上書きコピー
# cp -p /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
*** ホスト/ゲストOS両方で [#q45af487]
- /etc/ntp.conf の設定
# yum install ntp
# vi /etc/ntp.conf
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify not...
restrict 192.168.1.0 mask 255.255.255.0 nomodify notr...
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.n...
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
↓ 時刻同期先NTPサーバーを変更
server ntp.nict.jp # 日本標準時を提供しているNTPサー...
server ntp.jst.mfeed.ad.jp # 上記サーバーと直接同期し...
- NTPd起動
# ntpdate ntp.nict.jp
# /etc/rc.d/init.d/ntpd start
# chkconfig ntpd on
# chkconfig --list ntpd
- 同期確認
# ntpq -p
結果行の先頭に '*', '+' が付いていればok
ページ名: