一、设置A服务器为时间服务器(加入A服务器IP为172.18.102.2)

修改 /etc/ntp.conf,如下所示:

 命令:vi /etc/ntp.conf

 内容:

  # Undisciplined Local Clock. This is a fake driver intended for backup
  # and when no outside source of synchronized time is available.
  server 127.127.1.0 # local clock
  #fudge 127.127.1.0 stratum 10

2 启动时间服务器,命令如下:

 service ntpd status

 service ntpd start

3 查看启动结果,如下所示:

 命令:ntpq -p

 结果:

  remote refid st t when poll reach delay offset jitter
  ==============================================================================
  *LOCAL(0) .LOCL. 5 l 2 64 377 0.000 0.000 0.000

4 设置自启动,命令如下:

 chkconfig ntpd on

二、设置需要同步的服务器

1 修改 /etc/ntp.conf,如下:

 命令:vi /etc/ntp.conf

 内容:

  # Undisciplined Local Clock. This is a fake driver intended for backup
  # and when no outside source of synchronized time is available.
  server 172.18.102.2 # local clock 与服务器A机时间同步
  fudge 172.18.102.2 stratum 10

2 启动时间服务器,命令如下:

 service ntpd status

 service ntpd start

3 查看启动结果,如下所示:

 命令:ntpq -p

 结果:

  remote refid st t when poll reach delay offset jitter
  ==============================================================================
  172.18.102.2 LOCAL(0) 6 u 5 64 1 1.377 -7077.8 0.000

4 设置自启动,命令如下:

 chkconfig ntpd on

5 立即同步

 ntpdate -d 172.18.102.2

 

转载于:https://www.cnblogs.com/aimixiu/p/10565804.html

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐