安裝NTPD服務端
rpm -qa ntp | grep ntpd
檢測是否已經安裝,如未安裝執行yum安裝服務
yum install ntp
關閉防火牆
service iptables stop
設置開啓不自動啓動防火牆
chkconfig iptables off
修改配置文件/etc/ntp.conf
添加如下內容
restrict 192.168.100.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0 # localclock
fudge 127.127.1.0 stratum 10
將上面的如下內容進行註釋或者刪除
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
修改配置文件/etc/sysconfig/ntpd 使BIOS時間與系統時間同步
添加如下內容SYNC_HWLOCK=yes
重啓NTPD服務並設置開機啓動
service ntpd restart
chkconfig ntpd on
至此我們的時間同步服務器就搭建好了,可以將此臺機器作爲時間同步服務器啦~