联网状态下与互联网上提供的时钟服务器进行同步
同步命令 : ntpdate ntp4.aliyun.com
配置离线状态下的时钟同步
1、设置时钟同步服务器的时间(node04 2012-12-12 12:12:12)
将node05时间与node04同步
2、修改第一个配置文件 /etc/ntp.conf
添加如下内容
restrict 192.168.100.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0 # localclock
fudge 127.127.1.0 stratum 10
注释以后的服务器
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
3、修改第二个配置文件 vi /etc/sysconfig/ntpd
添加如下内容
SYNC_HWLOCK=yes
4、重启ntp服务
/etc/init.d/ntpd restart
5、时钟同步
在node05节点进行同步
命令 ntpdate node05 (时钟服务器)
ntpdate 192.168.100.88(时钟服务器)
注意:
防火墙未关闭的情况!
ntp服务已运行:
解决方法: