# rpm -q ntp
ntp-4.2.4p8-2.el6.x86_64 // 这表示已安装了,若是没有安装,这是空白。
红色部分是修改的。java
配置文件修改完成,保存退出,启动服务。服务器
service ntpd start
ntpstat 命令查看时间同步状态,这个通常须要5-10分钟后才能成功链接和同步。因此,服务器启动后须要稍等下。测试
其余的没列举spa
driftfile /var/lib/ntp/drift restrict 127.0.0.1 restrict -6 ::1 # 配置时间服务器为本地的时间服务器 server 192.168.1.135 restrict 192.168.1.135 nomodify notrap noquery server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys
OK,保存退出,请求服务器前,请先使用ntpdate手动同步下时间rest
# ntpdate -u 192.168.0.135
22 Dec 17:09:57 ntpdate[6439]: adjust time server 192.168.1.135 offset 0.004882 sec
而后启动服务server
service ntpd start
chkconfig --level 35 ntpd on
参考文献 http://acooly.iteye.com/blog/1993484blog