ページ「CentOS 6.10」と「Ntp Howto」の間の差分
(ページ間の差分)
ナビゲーションに移動
検索に移動
(ページの作成:「参考サイト: [http://pocketstudio.jp/centos/centos_faq_jp.html CentOS FAQ] ---- ==準備== [http://www.centos.org CentOS.org]の[http://www.centos.org/download Downloads]ページよりイメージ(.iso)をダウンロードしてDVDを作成。<br/> * CentOS-6.10-i386-bin-DVD1.iso * CentOS-6.10-i386-bin-DVD2.iso ==インストール== DVDブートでインストール開始。 # '''[Install or upgrade an existing system]'''を選択。<br/><br/> # '''[Di…」) |
(ページの作成:「Network Time Protocol(ネットワーク・タイム・プロトコル)は、ネットワークに接続される機器において、機器が持つ時計を正しい時刻へ同期するための通信プロトコル。 == 目的 == 時刻の同期。 == インストール == <pre> # yum install ntp </pre> == 設定 == <ol> <li>'''ntp.confの修正'''<br/> <syntaxhighlight lang="bash"> [root@hoge ~]# vi /etc/ntp.conf #restrict 192.168.1.0 mask 255.255.255…」) |
||
1行目: | 1行目: | ||
Network Time Protocol(ネットワーク・タイム・プロトコル)は、ネットワークに接続される機器において、機器が持つ時計を正しい時刻へ同期するための通信プロトコル。 | |||
== 目的 == | |||
時刻の同期。 | |||
== | == インストール == | ||
<pre> | |||
# yum install ntp | |||
</pre> | |||
== 設定 == | |||
<ol> | |||
<li>'''ntp.confの修正'''<br/> | |||
== | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
[root@hoge ~]# vi /etc/ntp.conf | |||
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap | |||
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap ← 追加(内部からの時刻同期を許可) | |||
server 0.rhel.pool.ntp.org | |||
server 1.rhel.pool.ntp.org | |||
server 2.rhel.pool.ntp.org | |||
↓ | |||
時刻同期先NTPサーバーを変更 | |||
server -4 ntp.nict.jp # 日本標準時を提供しているNTPサーバー(stratum 1) | |||
server -4 ntp.jst.mfeed.ad.jp # 上記サーバーと直接同期しているNTPサーバー(stratum 2) | |||
server -4 プロバイダのNTPサーバー名 # プロバイダのNTPサーバー | |||
</syntaxhighlight > | |||
<br> | |||
</li> | |||
<li>'''手動で時刻合わせ。'''<br/>NTPサーバー起動時に大幅に時刻がずれているとNTPサーバーが起動できないので、いったん、手動で時刻を合わせる。<br/> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
[root@hoge ~]# ntpdate ntp.nict.jp ← 手動で時刻を合わせる | |||
</syntaxhighlight> | </syntaxhighlight > | ||
<br> | |||
</li> | |||
<li>'''起動、自動起動の設定''' | |||
< | |||
</ | |||
< | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
[root@hoge ~]# /etc/rc.d/init.d/ntpd start ← NTPサーバー起動 | |||
ntpd を起動中: [ OK ] | |||
[root@hoge ~]# chkconfig ntpd on ← NTPサーバー自動起動設定 | |||
[root@hoge ~]# chkconfig --list ntpd ← NTPサーバー自動起動設定確認 | |||
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ← ランレベル2~5のonを確認 | |||
</syntaxhighlight > | |||
<br> | |||
</li> | |||
</ol> | |||
2023年5月11日 (木) 09:13時点における最新版
Network Time Protocol(ネットワーク・タイム・プロトコル)は、ネットワークに接続される機器において、機器が持つ時計を正しい時刻へ同期するための通信プロトコル。
目的
時刻の同期。
インストール
# yum install ntp
設定
- ntp.confの修正
[root@hoge ~]# vi /etc/ntp.conf #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap ← 追加(内部からの時刻同期を許可) server 0.rhel.pool.ntp.org server 1.rhel.pool.ntp.org server 2.rhel.pool.ntp.org ↓ 時刻同期先NTPサーバーを変更 server -4 ntp.nict.jp # 日本標準時を提供しているNTPサーバー(stratum 1) server -4 ntp.jst.mfeed.ad.jp # 上記サーバーと直接同期しているNTPサーバー(stratum 2) server -4 プロバイダのNTPサーバー名 # プロバイダのNTPサーバー
- 手動で時刻合わせ。
NTPサーバー起動時に大幅に時刻がずれているとNTPサーバーが起動できないので、いったん、手動で時刻を合わせる。
[root@hoge ~]# ntpdate ntp.nict.jp ← 手動で時刻を合わせる
- 起動、自動起動の設定
[root@hoge ~]# /etc/rc.d/init.d/ntpd start ← NTPサーバー起動 ntpd を起動中: [ OK ] [root@hoge ~]# chkconfig ntpd on ← NTPサーバー自動起動設定 [root@hoge ~]# chkconfig --list ntpd ← NTPサーバー自動起動設定確認 ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ← ランレベル2~5のonを確認