时间同步
集群中时间同步问题非常重要
环境:集群中的机器不能上网,ntp服务器不能冲网上同步时间:
vim /etc/ntp.config 在restrict后边添加:
restrict default nomodify notrap
server 127.127.1.0 #设置本地时间为同步服务器
fudge 127.127.1.0 stratum 10
vim /etc/sysconfig/ntpd 添加如下配置:
SYNC_HWCLOCK=yes
然后重启时间服务器:
service ntpd restart
watch ntpq -p
ntpdate -d 时间服务器IP
查看transmitted 参数是0-15表示正常
然后客户端就可以同步时间了
客户端设置:
安装ntp软件,vim /etc/ntp.conf 添加配置如下:
server 时间服务器IP地址 burst iburst
设置开机启动,启动ntp服务同步时间