centos-rhel服务器相关 / 未分类 · 2012年2月1日

虚拟机,时间不对的解决方法

如果服务器是虚拟机 ,有时会遇到时间 的怪问题,像今天的一个合作方的,就是时间老是快了,下面是解决方法
1.
Modify the kernel boot options by editing /boot/grub/grub.conf and adding the line “notsc divider=10” (for 64-bit) after the appropriate kernel line, as below. Clearly, this will vary depending on your exact install.:
Eg:
eg
vi /boot/grub/grub.conf
title CentOS (2.6.18-238.12.1.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-238.12.1.el5 ro root=LABEL=/ hda=noprobe hdb=noprobe notsc divider=10
2. 同步网络时间:
ntpdate time.nist.gov
 
 
3. Set the hardware clock to the newly synchronised time:
hwclock –systohc
最后 系统重启