linux時間同步
設置時區cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime聯網情況:ntpdate us.pool.ntp.org修改時間date -s 11:21:00查看NTP狀態service ntpd statusyum install -y ntpdchkconfig ntpd on#查看時區date -R#同步網絡時間ntpdate 1.centos.pool.ntp.org配置ntp服務端:vi /etc/ntp.confrestrict 172.16.0.0 mask 255.255.255.0 nomodify notrap#使用本地時鐘server 127.127.1.0fudge 127.127.1.0 stratum 10保存退出#開啟防火墻udp 123端口iptables -I INPUT -p udp --dport 123 -j ACCEPTservice iptables save#在啟動ntpd服務之前,先使用ntpdate手動同步下時間,免得本機與外部時間服務器時間差距太大,讓ntpd不能正常同步。ntpdate 0.centos.pool.ntp.org #啟動ntpd服務service ntpd start#其他機器機器發送同步請求ntpdate 172.16.0.11開機啟動/etc/rc.d/rc.local新聞熱點
疑難解答