
安装ntp服务:
如果是CentOS,命令:yum -y install ntp
如果是ubuntu,命令:apt-get install ntp
修改ntp服务器为国内服务器:
vi /etc/ntp.conf
注释掉一下内容:
#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
注释之后另起一行,添加如下内容:
#server后的'prefer'后缀意味着该服务器优先使用
server cn.pool.ntp.org prefer
server 0.cn.pool.ntp.org
server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org
server 3.cn.pool.ntp.org
server tw.pool.ntp.org
server 0.tw.pool.ntp.org
server 1.tw.pool.ntp.org
server 2.tw.pool.ntp.org
server 3.tw.pool.ntp.org
:wq保存
配置ntp服务开机自动启动:
如果ubuntu系统没有安装chkconfig需要单独安装一下:apt-get install chkconfig
chkconfig ntpd on
手动启动ntpd服务进行同步:service ntpd start
使用date命令查看当前时间是否同步完成(ntpd属于定时任务,有时候会有几秒的延迟时间)
解决Vmware虚拟机时间同步问题有很多种方法,比如使用VMwaretools工具或者使用命令程序来调整时间等,本教程也是就VMware虚拟机的同步问题给出解决方法,方法贵不在多,在于好用,有需要的朋友可以参考下。很多时候在使用Vmware虚拟机时,会遇到时间不准确,在网上搜索后自己测试了一下。
虚拟机如果安装在Microsoft旗下OS,那么仅需安装VMwareTools就可以了,虚机的系统会利用VMwareTools读取主机系统的硬件时钟进行同步和校准。如此一来,只要主机的时钟不出问题,那么虚机的时间就不会出现问题,误差应该在10秒之内。
基本上的意思是:针对不同的发行版本系统,在引导内核的指令中加入不同的参数来使用VirtualHardwareClock来进行时间的同步及校准,或者使用NTP,VMwareTools等等不同的方法来进行GuestOS的时间同步及校准
命令:ntpdate 时间服务器ntpdate time.windows.com
时间同步服务器地址:
time.nist.gov
time.windows.com
time-nw.nist.gov
time-a.nist.gov
time-b.nist.gov
默认这个时间服务器,你可以找其他时间服务器地址,希望对你有帮助!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)