linux系统时间同步更新

来源:互联网 发布:java gradle 打包命令 编辑:程序博客网 时间:2024/04/18 13:32

    linux中的时钟分为系统时钟和硬件时钟。硬件时钟通过bioss进行设置,系统时钟通过linux kernel进行设置。当linux启动时,bioss会读取系统时钟的时钟设置。在linux中涉及时间设置的命令有date,clock,hwclock、ntpdate等命令。

     实现linux的时间同步需要操作两个步骤:

1、ntpdate cn.pool.ntp.org

      国内常用的ntp服务器

  • 1.cn.pool.ntp.org
  • 2.cn.pool.ntp.org
  • 3.cn.pool.ntp.org
  • 0.cn.pool.ntp.org
  • cn.pool.ntp.org
  • tw.pool.ntp.org
  • 0.tw.pool.ntp.org
  • 1.tw.pool.ntp.org
  • 2.tw.pool.ntp.org
  • 3.tw.pool.ntp.org

2、将当前实时更新的时间写入到bioss中。通过使用clock -w 或hclock -w将当前的实时时间写入到bioss中,下次服务器重启后,系统仍然能够保持系统时间的一致性。



0 0
原创粉丝点击