OpenVZ是读取母机的时间的,所以在以下设置前必须确保母机时间已同步!!!
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #修改时区到东8区。
date -R #查看d时区设置。
接下来调整系统时间与时间服务器同步
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #修改时区到东8区。
date -R #查看d时区设置。
接下来调整系统时间与时间服务器同步
yum install -y ntp #安装ntp
ntpdate -d us.pool.ntp.org #调试查看时间差异
ntpdate us.pool.ntp.org #同步时间
date -R # 检查时间匙否同步
修改 ntp d配置文件
ntpdate -d us.pool.ntp.org #调试查看时间差异
ntpdate us.pool.ntp.org #同步时间
date -R # 检查时间匙否同步
修改 ntp d配置文件
nano /etc/sysconfig/ntpd
SYNC_HWCLOCK=yes #同步独立主机d硬件时钟
SYNC_HWCLOCK=yes #同步独立主机d硬件时钟
配置开机启动ntp服务,定期同步时间
chkconfig –levels 235 ntpd on
启动ntp同步
启动ntp同步
/etc/init.d/ntpd start
没有评论:
发表评论