首页 > 系统服务 > 详细

如何更新linux服务器的系统时间

时间:2015-09-15 20:18:04      阅读:318      评论:0      收藏:0      [点我收藏+]

由于服务器的时间出现错误,可采用以下方法来更新linux服务器的系统时间:


方法一:

1,首先yum 安装本地ntpdate客户端,更新ntpdate cn.pool.ntp.org时使用

[root@localhost ~]# yum install ntpdate


2,使用 ntpdate cn.pool.ntp.org进行更新。

[root@localhost ~]# ntpdate cn.pool.ntp.org

15 Sep 16:46:32 ntpdate[15965]: adjust time server 202.112.29.82 offset 0.010499 sec


或者使用cn.pool.ntp.org 的ip地址进行更新。

[root@localhost ~]# ping cn.pool.ntp.org

PING cn.pool.ntp.org (202.112.10.36) 56(84) bytes of data.

64 bytes from gus.buptnet.edu.cn (202.112.10.36): icmp_seq=1 ttl=44 time=107 ms

64 bytes from gus.buptnet.edu.cn (202.112.10.36): icmp_seq=2 ttl=44 time=86.2 ms


ntpdate 

[root@localhost ~]# ping cn.pool.ntp.org

PING cn.pool.ntp.org (202.112.10.36) 56(84) bytes of data.

64 bytes from gus.buptnet.edu.cn (202.112.10.36): icmp_seq=1 ttl=44 time=107 ms

64 bytes from gus.buptnet.edu.cn (202.112.10.36): icmp_seq=2 ttl=44 time=86.2 ms


[root@localhost ~]# ntpdate 202.112.10.36

15 Sep 16:49:14 ntpdate[15966]: adjust time server 202.112.10.36 offset 0.010657 sec


3,更新完后要用 clock -w 或 hwclock -w 实时间写入到BIOS中,这样下次启动时,时间就会自动更新了。

[root@localhost ~]# clock -w



方法二:

 直接使用命令进行更新,ntpdate time-a.nist.gov

[root@localhost ~]#  ntpdate time-a.nist.gov

本文出自 “清风明月” 博客,请务必保留此出处http://liqingbiao.blog.51cto.com/3044896/1695013

如何更新linux服务器的系统时间

原文:http://liqingbiao.blog.51cto.com/3044896/1695013

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!