当前位置:网站首页>Chrony time synchronization
Chrony time synchronization
2022-07-29 08:21:00 【Adventures of procedural ape】
List of articles
1. chrony brief introduction :
Realization NTP Free software of the protocol . The system clock can be synchronized with NTP The server , Reference clock ( for example GPS Receiver ) And the use of watches Synchronize with manual input from the keyboard . adopt Internet The typical accuracy between two synchronous machines is within a few milliseconds , stay LAN On , The precision is usually tens of microseconds . Use hard Piece timestamp or hardware reference clock , It can achieve sub microsecond precision .
2. chrony Install and use
2.1. chrony install
| host | IP |
|---|---|
| node01 | 192.168.80.131 |
| node02 | 192.168.80.132 |
| node03 | 192.168.80.133 |
Each node is installed chrony
yum install chrony -y
systemctl enable chronyd.service
systemctl restart chronyd.service
systemctl status chronyd.service

Release within the firewall , because NTP Use 123/UDP Port agreement , So allow NTP The service can be .( Ignore if the firewall is closed )
firewall-cmd --add-service=ntp --permanent
firewall-cmd --reload
2.2 modify node01 The configuration file
Change the synchronization server in the configuration file to a domestic time server ( Recommend Alibaba and Tencent )
vim /etc/chrony.conf
server ntp.aliyun.com iburst
server ntp1.aliyun.com iburst
server ntp2.aliyun.com iburst

restart
systemctl restart chronyd.service
systemctl status chronyd.service

Force synchronization of the system clock :
# chronyc -a makestep
View time synchronization source status :
# chronyc sourcestats
Check the time synchronization source :
# chronyc sources -v
2.3 node Node configuration chrony
stay /etc/chrony.conf Comment out the previous IP, newly added node01 The host IP The address will do ( Remember to restart chrony)

2.4 Configuration file details
# Use pool.ntp.org The public server in the project . With server open , In theory you can add as many servers as you want .
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
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
# Calculate the ratio of server time to actual time , It is then recorded in a file , Make the best time compensation adjustment for the system after system restart .
driftfile /var/lib/chrony/drift
# chronyd Adjust the time to slow down or speed up according to the demand ,
# In some cases the system clock may drift too fast , Cause the time adjustment to take too long .
# The instruction enforces chronyd Adjust the period , Stepwise adjustment of the system clock when greater than a certain threshold .
# Only for chronyd When the startup time exceeds the specified limit ( Negative values can be used to disable restrictions ) No more clock updates to take effect .
makestep 1.0 3
# A kernel mode is enabled , In this mode , System time per 11 Minutes are copied to the real-time clock (RTC).
rtcsync
# Enable hardware timestamping on all interfaces that support it.
# By using hwtimestamp The directive enables the hardware timestamp
#hwtimestamp eth0
#hwtimestamp eth1
#hwtimestamp *
# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2
# Specify a host 、 subnet , Or network to allow or deny NTP Connect to the machine that ACTS as the clock server
#allow 192.168.0.0/16
#deny 192.168/16
# Serve time even if not synchronized to a time source.
local stratum 10
# The specified contains NTP The file that verifies the key .
#keyfile /etc/chrony.keys
# Specifies the directory for the log files .
logdir /var/log/chrony
# Select which information is logged.
#log measurements statistics tracking
-----------------------------------
The copyright belongs to the author : come from 51CTO The original work of blogger Nangong Chengfeng , Please contact the author for permission to reprint , Otherwise, the legal liability will be investigated
Centos7 Cluster time synchronization (Chrony)
https://blog.51cto.com/heian99/3220521
边栏推荐
- The difference between torch.tensor and torch.tensor
- 随机抽奖转盘微信小程序项目源码
- Third week weekly report resnet+resnext
- Solve the problem of MSVC2017 compiler with yellow exclamation mark in kits component of QT
- Ga-rpn: recommended area network for guiding anchors
- Alibaba political commissar system - Chapter 4: political commissars are built on companies
- Segment paging and segment page combination
- 用户身份标识与账号体系实践
- New energy shared charging pile management and operation platform
- Noise monitoring and sensing system
猜你喜欢

Inclination monitoring solution of Internet of things

PostgreSQL手动创建HikariDataSource解决报错Cannot commit when autoCommit is enabled

Reading papers on false news detection (4): a novel self-learning semi supervised deep learning network to detect fake news on

Chrony 时间同步

Compatible with cc1101/cmt2300-dp4301 sub-1g wireless transceiver chip

ROS tutorial (Xavier)

Solve the problem of MSVC2017 compiler with yellow exclamation mark in kits component of QT

Simulation of four way responder based on 51 single chip microcomputer

New energy shared charging pile management and operation platform

Proteus simulation based on msp430f2491
随机推荐
Phy6252 is an ultra-low power Bluetooth wireless communication chip for the Internet of things
The difference between torch.tensor and torch.tensor
Qt/pyqt window type and window flag
ML.NET相关资源整理
What constitutes the smart charging pile system?
Eps32+platform+arduino running lantern
DAC0832 waveform generator based on 51 single chip microcomputer
sql判断语句的编写
ROS common instructions
Smart energy management system solution
RPC和REST
Third week weekly report resnet+resnext
Week 1 task deep learning and pytorch Foundation
Pnpm install appears: err_ PNPM_ PEER_ DEP_ ISSUES Unmet peer dependencies
centos7/8命令行安装Oracle11g
Unity多人联机框架Mirro学习记录(一)
Markdown concise grammar manual
torch.Tensor和torch.tensor的区别
[beauty of software engineering - column notes] 23 | Architect: programmers who don't want to be architects are not good programmers
Security baseline of network security