NTP服务

#Linux #CentOS #NTP #Time

 

NTP简介(What)

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

NTP的作用(Why)

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

现在所有的计算机、手机都会跟时钟服务器同步,给我们提供更准确的时间。

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

1、安装ntp:

yum install ntp

2、修改/etc/ntp.conf

# 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、设置时区

timedatectl set-timezone Asia/Shanghai

或者

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

4、时间同步

手工发起同步:

ntpdate ntp1.aliyun.com

date查看时间是否已经同步

启动NTP服务:

service ntpd start

设置开机启动:

chkconfig ntpd on

相关推荐

  1. <span style='color:red;'>NTP</span><span style='color:red;'>服务</span>

    NTP服务

    2024-01-09 11:28:01      42 阅读
  2. NTP服务搭建

    2024-01-09 11:28:01       17 阅读
  3. ntp服务器搭建

    2024-01-09 11:28:01       17 阅读
  4. 数据库服务器NTP调整

    2024-01-09 11:28:01       18 阅读
  5. WINDOWS增加NTP服务器功能

    2024-01-09 11:28:01       18 阅读
  6. Windows Server设置NTP服务器

    2024-01-09 11:28:01       20 阅读
  7. ntp校时服务器ntp授时服务器ntp时钟服务器

    2024-01-09 11:28:01       40 阅读
  8. 13_1 Linux 邮件服务NTP时间服务

    2024-01-09 11:28:01       8 阅读

最近更新

  1. react小白面试不得不会的20个问题——第二篇

    2024-01-09 11:28:01       0 阅读
  2. 简单滤波算法伪码

    2024-01-09 11:28:01       0 阅读
  3. Mongodb索引简介

    2024-01-09 11:28:01       0 阅读
  4. Linux 6种日志查看方法

    2024-01-09 11:28:01       0 阅读
  5. 案例研究(Case Study)是什么?怎么写?

    2024-01-09 11:28:01       0 阅读
  6. Linux虚拟化技术:从Xen到KVM

    2024-01-09 11:28:01       0 阅读
  7. 深度学习图片增强方式

    2024-01-09 11:28:01       0 阅读
  8. 什么是DNS欺骗

    2024-01-09 11:28:01       1 阅读
  9. leetcode hot 100 刷题记录

    2024-01-09 11:28:01       1 阅读
  10. 全面解析C#:现代编程语言

    2024-01-09 11:28:01       1 阅读
  11. 【深入探索】揭秘SQL Server的多重身份验证模式

    2024-01-09 11:28:01       1 阅读

热门阅读

  1. 数据的相似度计算

    2024-01-09 11:28:01       36 阅读
  2. vue 实现调起打印机打印图片 与图片下载

    2024-01-09 11:28:01       41 阅读
  3. 图片自适应各种设备尺寸

    2024-01-09 11:28:01       39 阅读
  4. 【Leetcode】238.除自身以外数组的乘积

    2024-01-09 11:28:01       52 阅读
  5. 深度学习知识点总结

    2024-01-09 11:28:01       41 阅读
  6. Seata分布式事务

    2024-01-09 11:28:01       42 阅读
  7. Angular中的装饰器有哪些?怎么用?

    2024-01-09 11:28:01       33 阅读
  8. linux: ps 与 pidof 用法详解

    2024-01-09 11:28:01       32 阅读
  9. 【Linux】Linux系统编程——Linux常用快捷键

    2024-01-09 11:28:01       35 阅读
  10. 边缘计算设备是什么意思。

    2024-01-09 11:28:01       35 阅读
  11. ES6---扩展运算符详解

    2024-01-09 11:28:01       33 阅读
  12. 【力扣100】74.搜索二维矩阵 || 列表推导式

    2024-01-09 11:28:01       39 阅读