一、安装ntpdate
yum -y install ntp ntpdate
二、同步时间
ntpdate time.nist.gov
错误:
如果遇到:26 Jun 19:04:58 ntpdate[206894]: the NTP socket is in use, exiting
则:/etc/init.d/ntpd stop
出现 Shutting down ntpd: [ OK ] (说明成功 在运行一次 ntpdate time.nist.gov)
ntp常用服务器如下:
中国国家授时中心:210.72.145.44
NTP服务器(上海) :ntp.api.bz
美国: time.nist.gov
复旦: ntp.fudan.edu.cn
微软公司授时主机(美国) :time.windows.com
北京邮电大学 : s1a.time.edu.cn
清华大学 : s1b.time.edu.cn
北京大学 : s1c.time.edu.cn
台警大授时中心(台湾):asia.pool.ntp.org
三、查看时间
date
这个CST代表的是东8区也就是北京时间,如果不是需要修改如下。
1、点击System----->Administrator----->Date & Time,并输入root密码进去。
2、找到上海,点击ok
再回去看时间就是CST的时间了。