为了使服务器集群的系统时间维持在同一时间。使用对时程序必不可少。一般存在使用ntpdate方式和ntpd方式。 服务器
ntpdate方式会使系统时间在对时时刻发生跳变,这对某些依赖系统时间来决定是否超时的程序具备很大的影响。 spa
ntpd方式采用一种优雅的方式。逐步逼近最新时刻。这样变化过程对依赖系统时间的程序影响较小。 rest
ntpd客户端配置: server
打开 /etc/ntp.conf ip
注释掉 集群
#server 0.rhel.pool.ntp.org
#server 1.rhel.pool.ntp.org
#server 2.rhel.pool.ntp.org 配置
修改 date
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10 service
为国家授时中心服务器ip 程序
server 210.72.145.44 # local clock
fudge 210.72.145.44 stratum 10
添加
ntpd_enable="YES"
启动服务
service ntpd restart
chkconfig ntpd on
能够使用的命令
ntpq -p
ntpstat