当前位置:网站首页>【NTP/chrony】如何利用chrony配置NTP服务
【NTP/chrony】如何利用chrony配置NTP服务
2022-07-21 05:39:00 【Brux_NiuBility】
NTP服务基本配置
- 服务器:CentOS 8.x, FQDN为:server.ztlab.org.cn
- 客户端:CentOS 8.x, FQDN为:linux2.ztlab.org.cn
Server端相关软件安装及配置
软件安装
[[email protected] ~]# dnf install -y chrony
修改chrony主配置文件/etc/chrony.conf
作为本地网络的NTP服务器,需要权威的外部NTP服务器来同步自己的时间
[[email protected] ~]# vi /etc/chrony.conf
<output...>
pool cn.ntp.org.cn iburst
<output...>
allow 192.168.0.0/16
<output...>
local stratum 10
启动服务
[[email protected] ~]# systemctl enable --now chronyd.service
添加防火墙策略
[[email protected] ~]# firewall-cmd --permanent --add-port=123/udp
success
[[email protected] ~]# firewall-cmd --reload
success
状态检查
[[email protected] ~]# ss -anlptu4
udp UNCONN 0 0 0.0.0.0:123 0.0.0.0:* users:(("chronyd",pid=2147,fd=8))
udp UNCONN 0 0 127.0.0.1:323 0.0.0.0:* users:(("chronyd",pid=2147,fd=6))
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=1063,fd=5))
[[email protected] ~]# chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- 114.67.102.75 4 6 17 64 +273us[ -33us] +/- 54ms
^+ 106.75.107.80 2 6 17 63 -1120us[-1426us] +/- 20ms
^- 111.230.50.201 3 6 17 64 +87us[ -219us] +/- 90ms
[[email protected] ~]# chronyc client
Hostname NTP Drop Int IntL Last Cmd Drop Int Last
===============================================================================
linux2.ztlab.org.cn 2310 0 10 - 119 0 0 - -
linux4.ztlab.org.cn 2286 0 10 - 247 0 0 - -
linux3.ztlab.org.cn 2284 0 10 - 126 0 0 - -
<output...>
Client端相关软件安装及配置
软件安装
[[email protected] ~]# dnf install -y chrony
修改chrony主配置文件/etc/chrony.conf
作为本地网络的NTP服务器,需要权威的外部NTP服务器来同步自己的时间
[[email protected] ~]# vi /etc/chrony.conf
<output...>
pool server.ztlab.org.cn iburst
启动服务
[[email protected] ~]# systemctl enable --now chronyd.service
状态检查
[[email protected] ~]# chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* server.ztlab.org.cn 10 10 377 212 +9722ns[+9604ns] +/- 232us
边栏推荐
- 小程序 如何上传多张图片
- 基于tensorflow2.0+使用bert获取中文词、句向量并进行相似度分析
- Error encountered when configuring trust in vscode: linking with 'x86_ 64-w64-mingw32-gcc‘failed:exit code:1
- The 64 bit version of Visio cannot be installed because the following 32-bit program solution is found on your PC
- 攻防技术第二篇之-知己(防御手段)
- 云原生与低代码平台成就敏捷企业
- js 常用的 方法
- Writing traffic lights with J S
- Oracle设置最大连接数
- 获取header和cookie的简易方法
猜你喜欢
HCIA NAT实验报告 7.14
How to upload multiple pictures by applet
风口浪尖上的低代码工具革命
机器学习K-均值——nonzero(clusterAssment[冒号,0].A==cent
The 64 bit version of Visio cannot be installed because the following 32-bit program solution is found on your PC
策略中心——企业建设数智运营平台的大脑
mgre与ospf综合实验
Number of columns in MySQL statistics table
牛客刷题——剑指offer
A simple and easy-to-use translation program
随机推荐
TypeScript(二)
Script loads data into JSON file
小程序 如何上传多张图片
数据可视化第四章答案
使用 uni-app 预览图片并且保存图片
OOM 分析工具 MAT
小程序如何使用自定义导航栏
How to use a custom navigation bar for applets
生成自签名证书:生成证书和秘钥
数字时代下,企业运营管理的“数智”变革
策略中心——企业建设数智运营平台的大脑
Data visualization Chapter 4 answers
A simple and easy-to-use translation program
BT.656接口速率
hcip第八天
How to exit the applet and re-enter the latest version
Download of typora and use of markdown
Structured design SD
ROS 多坐标变换
同组“高龄”员工被辞退,互联网中年危机真的有那么夸张吗?