Linux CentOS 8.5 安装NTP时间服务器 chrony时间同步服务 阿里云NTP时间服务器+腾讯云NTP时间服务器

特殊云服务,可能只有DMZ区域服务器可以访问特定的互联网地址,而应用服务器和数据库服务器不能访问互联网的。同步时间可以开通访问DMZ时间服务器.

本文依这篇为例:详细教程 Centos8.5 基于 k8s v1.30.1 部署高可用集群 kubeadm 安装 kubernetes v1.30.1 docker集群搭建 延长证书有效期-CSDN博客

常见网络架构:

1 CentOS 8 默认使用的时间同步服务是 chronyd ,能够保持系统时间的同步更准确。

复制代码
#master11如果没有安装,执行
yum install chrony
#vim  /etc/chrony.conf
pool 2.centos.pool.ntp.org iburst --> #pool 2.centos.pool.ntp.org iburst
#allow 192.168.0.0/16 --> allow 192.168.50.0/24
server ntp5.aliyun.com iburst
server ntp6.aliyun.com iburst
server ntp7.aliyun.com iburst
server time1.tencentyun.com iburst
server time2.tencentyun.com iburst
server time3.tencentyun.com iburst

#启动配置
systemctl enable chronyd
systemctl start chronyd
#查看
systemctl status chronyd

#查看同步

复制代码
root@master11 ~]# chronyc sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 203.107.6.88                  2   6   177     7  +4846us[+7827us] +/-   23ms

[root@master11 ~]# timedatectl status
               Local time: Sat 2024-05-18 22:12:08 CST
           Universal time: Sat 2024-05-18 14:12:08 UTC
                 RTC time: Sat 2024-05-18 14:12:07
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

2 节点配置

复制代码
[root@slave12 ~]# vim /etc/chrony.conf
pool 2.centos.pool.ntp.org iburst -->#pool 2.centos.pool.ntp.org iburst
server 192.168.50.11 iburst
#查看同步
[root@slave12 ~]# chronyc sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* master11                      3   6    37    63  +1257ns[+3073us] +/-   23ms
[root@slave12 ~]# chronyc sourcestats -v
                             .- Number of sample points in measurement set.
                            /    .- Number of residual runs with same sign.
                           |    /    .- Length of measurement set (time).
                           |   |    /      .- Est. clock freq error (ppm).
                           |   |   |      /           .- Est. error in freq.
                           |   |   |     |           /         .- Est. offset.
                           |   |   |     |          |          |   On the -.
                           |   |   |     |          |          |   samples. \
                           |   |   |     |          |          |             |
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
master11                    6   3   136     -4.415     52.325    -16ns   568us

[root@slave13 ~]# vim /etc/chrony.conf
pool 2.centos.pool.ntp.org iburst -->#pool 2.centos.pool.ntp.org iburst
server 192.168.50.11 iburst
[root@slave13 ~]# chronyc sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* master11                      3   6    17     4    -17us[  -21us] +/-   24ms

3 chronyc 可配置

相关推荐
南境十里·墨染春水17 分钟前
linux学习进展 信号
linux·服务器·学习
SiYuanFeng40 分钟前
一展使用gpt-5-mini和gemini-3.1-flash-image-preview-0.5k的运行demo代码
linux·python·gpt
YuanDaima204842 分钟前
堆(优先队列)基础原理与题目说明
linux·运维·服务器·人工智能·python··代码
another heaven42 分钟前
【软考 对称加密与非对称加密】
服务器·网络
生万千欢喜心42 分钟前
linux 安装 人大金仓数据库
linux·运维·数据库
傻啦嘿哟1 小时前
Python多进程编程:用multiprocessing突破GIL限制
服务器·网络·数据库
@insist1231 小时前
网络工程师-网络规划与设计(三):数据中心机房设计规范全解析
服务器·网络·数据库·网络工程师·软考·软件水平考试
mounter6251 小时前
深度拦截:Linux 内核引入 Firmware LSM 挂钩,eBPF 再下一城!
linux·服务器·ebpf·kernel·firmware
编程百晓生1 小时前
《SAP FICO系统配置从入门到精通共40篇》021、CO-PC实战笔记:在制品与差异计算,那些年车间里的“账实不符”
服务器·人工智能·笔记·ar·从入门到精通·sap fico·sap fico系统
坚持就完事了1 小时前
scp命令
linux·运维·服务器