服务器使用ntpd对时--客户端配置
服务器使用ntpd对时--客户端配置
服务器使用ntpd对时--客户端配置
为了使服务器集群的系统时间维持在同一时间。使用对时程序必不可少。通常存在使用ntpdate方式和ntpd方式。
www.2cto.com
ntpdate方式会使系统时间在对时时刻发生跳变,这对某些依赖系统时间来决定是否超时的程序具有很大的影响。
ntpd方式采用一种优雅的方式。逐步逼近最新时刻。这样变化过程对依赖系统时间的程序影响较小。
ntpd客户端配置:
打开 /etc/ntp.conf
注释掉
#server 0.rhel.pool.ntp.org
#server 1.rhel.pool.ntp.org
#server 2.rhel.pool.ntp.org
修改
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
为国家授时中心服务器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
评论暂时关闭