前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOS 7时间同步(NTP)

CentOS 7时间同步(NTP)

作者头像
mingmingcome
发布2021-11-29 15:34:10
3K0
发布2021-11-29 15:34:10
举报

begin 2020年7月5日10:55:03

NTP简介(What)

网络时间协议(英语:Network Time Protocol,缩写:NTP)是在数据网络潜伏时间可变的计算机系统之间通过分组交换进行时钟同步的一个网络协议,位于OSI模型的应用层。

明明说:时间同步协议

NTP的作用(Why)

NTP的作用是为了所有参与计算机的协调世界时(UTC)时间同步到几毫秒的误差内。

明明说:小时候家里会报点的老钟,跑了一段时间后就会慢几分钟,然后对着电视里校准。类似地,现在所有的计算机、手机都会跟时钟服务器同步,给我们提供更准确的时间。

CentOS基于NTP的时间同步(How)

1、安装ntp:

yum install ntp

2、修改/etc/ntp.conf

代码语言:javascript
复制
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).

# new(新增)
server ntp1.aliyun.com prefer
server ntp2.aliyun.com

# old(原有)
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

3、时间同步

手工发起同步:

ntpdate ntp1.aliyun.com

date查看时间是否已经同步

启动NTP服务:

service ntpd start

设置开机启动:

chkconfig ntpd on

end 2020年7月5日11:33:50

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-07-05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • NTP简介(What)
  • NTP的作用(Why)
  • CentOS基于NTP的时间同步(How)
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档