您的位置:首页 > 运维架构 > Linux

centos设置时钟同步时间

2014-03-12 17:07 459 查看
用ntpdate同步时间
clock -w 硬件同步
如果出错,看一下ntp服务是否启动,可以用service ntpd stop再试



如果clock和date时间不同
[xxx@mtg ~]# clock
2016年01月15日 星期五 10时34分39秒 -0.234710 seconds
[xxx@mtg ~]# date
2016年 01月 15日 星期五 10:42:12 CST

硬件时钟和系统时钟同步
[xxx@mtg ~]# hwclock --hctosys
[xxx@mtg ~]# clock
2016年01月15日 星期五 10时37分37秒 -0.859714 seconds
[xxx@mtg ~]# date
2016年 01月 15日 星期五 10:37:41 CST

和时间服务器同步
[xxx@mtg ~]# ntpdate time.windows.com
15 Jan 10:45:45 ntpdate[28529]: step time server time.windows.com offset 449.438743 sec
[xxx@mtg ~]# date
2016年 01月 15日 星期五 10:45:50 CST

系统时钟和硬件时钟同步
[xxx@mtg ~]# hwclock --systohc
[xxx@mtg ~]# date
2016年 01月 15日 星期五 10:46:23 CST
[xxx@mtg ~]# clock
2016年01月15日 星期五 10时46分28秒 -0.640991 seconds
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  centos 时间同步