192.168.1.30 做服務器時間
192.168.1.40 同步30
192.168.1.50 同步30
step1.在30機器上修改ntp.conf
添加:
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
說明:根據自己的該啊
注銷:
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst
添加:
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
保證BIOS(主板)與系統時間同步
vim /etc/sysconfig/ntpd
添加:SYNC_HWLOCK=yes
啟動ntpd的運行進程
service ntpd start
service ntpd status --保證服務啟動
在40機器上:
[root@saver1 ~]# ntpdate -u 192.168.1.30
28 Jul 13:03:37 ntpdate[2698]: step time server 192.168.1.30 offset 14401.695083 sec
在50機器上:
[root@saver2 ~]# ntpdate -u 192.168.1.30
28 Jul 13:03:51 ntpdate[2663]: step time server 192.168.1.30 offset 14401.690938 sec
date 查看時間已經同步
配置定時器,定時每分鍾與時鍾服務器進行同步
crontab -e
*/1 * * * * /usr/sbin/ntpdate 192.168.1.30
《完》