# rpm -q ntp
ntp-4.2.4p8-2.el6.x86_64    // 这表示已安装了,如果没有安装,这是空白。

二、/etc/ntp.conf

  红色部分是修改的。

设置CentOS6.5时钟同步

 

设置CentOS6.5时钟同步

 

  配置文件修改完成,保存退出,启动服务。

service ntpd start

  ntpstat 命令查看时间同步状态,这个一般需要5-10分钟后才能成功连接和同步。所以,服务器启动后需要稍等下。

三、配置其他节点

  其他的没列举

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手动同步下时间

# ntpdate -u 192.168.0.135

22 Dec 17:09:57 ntpdate[6439]: adjust time server 192.168.1.135 offset 0.004882 sec

  然后启动服务

service ntpd start

四、配置开机启动

 

chkconfig --level 35 ntpd on

 

 

 

参考文献 http://acooly.iteye.com/blog/1993484

相关文章:

  • 2021-06-09
  • 2021-11-30
  • 2021-08-19
  • 2022-02-08
  • 2021-12-10
  • 2021-06-26
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-12-07
  • 2021-07-04
相关资源
相似解决方案