ä¸ãæå¡å¨é
ç½®
1 å®è£
ntp
yum install ntp -y
2 ä¿®æ¹ntpé
ç½®æ件
vi /etc/ntp.conf
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
#server 2.centos.pool.ntp.org
server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
注ï¼æå¡ç«¯çé
ç½®æ件å
ç½çé
ç½®ä¸ç¥æä¸åï¼å¦æå
ç½æå¾å¤æºå¨ï¼åªéè¦é
ç½®ä¸å°å¤ç½æºå¨æå¡ç«¯ï¼ç¶åé
ç½®å
ç½çï¼å®è£
æ¹å¼é½ä¸æ ·ï¼åªæ¯å
ç½çé
ç½®æ件/etc/ntp.confç¥æä¸å
nomodify - ç¨æ·ç«¯ä¸è½æ´æ¹ntpæå¡å¨çæ¶é´åæ°
noquery - ç¨æ·ç«¯ä¸è½ä½¿ç¨ntpqï¼ntpcçå½ä»¤æ¥æ¥è¯¢ntpæå¡å¨
notrap - ä¸æä¾trapè¿ç«¯ç»é
3 å¯å¨
/etc/rc.d/init.d/ntpd start
4 设置å¼æºå¯å¨
chkconfig ntpd on
5 æ¥è¯¢ç½ç»ä¸çNTPæå¡å¨ï¼åæ¶æ¾ç¤ºå®¢æ·ç«¯åæ¯ä¸ªæå¡å¨çå
³ç³»
ntpq -p å
¶ä¸ï¼
remote - æ¬æºåä¸å±ntpçipæ主æºåï¼â+â表示ä¼å
ï¼â*â表示次ä¼å
refid - åèä¸ä¸å±ntp主æºå°å
st - stratumé¶å±
when - å¤å°ç§åæ¾ç»åæ¥è¿æ¶é´
poll - ä¸æ¬¡æ´æ°å¨å¤å°ç§å
reach - å·²ç»åä¸å±ntpæå¡å¨è¦æ±æ´æ°ç次æ°
delay - ç½ç»å»¶è¿
offset - æ¶é´è¡¥å¿
jitter - ç³»ç»æ¶é´ä¸biosæ¶é´å·®
6 å
ç½å®¢æ·ç«¯é
ç½®
å®è£
åå¯å¨æ¹å¼é½ä¸æ ·ï¼åªæ¯serverçé
ç½®ä¸ä¸æ ·ï¼æserverçé
ç½®ï¼ä¿®æ¹æè¿æ¥å¤ç½çé£å°å
ç½IP
server 192.168.1.8
è¿æ¯æä¹åå®è£
çè®°å½ï¼è¯¦ç»ä½ å¯ä»¥åèï¼
http://mnt.conf.blog.163.com/blog/static/115668258201432492034844/追é®crontab -e è¦ å ä»ä¹åï¼
server 192.168.11.1 å¨åªè®¾ç½® æ¯å¨
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 8 æ¹å ï¼
追çserver 192.168.11.1 æ¯å¨å
¶ä»å
ç½ä¸çntp.confä¸é
ç½®
ä½ ä¸å
±æå å°éè¦é
ç½®
追é®11. 1 æ¯å¤ç½æºå¨ ï¼ 11.1 å
è· å
±äº«æå¡å¨åæ¥ ï¼ ç¶å å
±äº«æå¡å¨è·ééæºåæ¥ å¤§çº¦ 30å¤å°çï¼ 211.61å·²ç»è· 11.1 åæ¥äº ï¼ä½æ¯å¨å
¶ä»æºå¨ä¸ ntpdate 211.61 ä¸è¡
追çä½ æä¸å°å¯ä»¥è¿æ¥å¤ç½çæºå¨é
ç½®ntpdï¼å
ç½å
¶ä»æºå¨è·è¿å°æºå¨è¿è¡æ¶é´åæ¥ï¼å°±è¡äºï¼
å¦å¤ï¼ä½ 注æntpd ä¸ntpdateçåºå«ï¼ä¸è¦æ··æ·äº