# # # # #4. How to synchronize system time ######
1. Service-side
Yum Install Chrony-y # #安装服务
vim/etc/chrony.conf # #主配置文件
# Allow NTP Client access from the local network.
192.168/16 # #允许谁去同步我的时间
# Serve Time even if not synchronized to any NTP server.
Stratum local #不去同步任何人的时间, time synchronization server level
System Restart Chronyd
Systemctl Stop Firewalld
2. Client
Vim/etc/chrony.conf
3 #server 0.rhel.pool.ntp.org Iburst
4 #server 1.rhel.pool.ntp.org iburst====>server Ntpserverip iburst
5 #server 2.rhel.pool.ntp.org iburst====>
6 #server 3.rhel.pool.ntp.org Iburst
Systemctl Restart Chronyd
Test:
[Email protected] ~]# Chronyc sources-v
Sources = 1
.--Source mode ' ^ ' = server, ' = ' = Peer, ' # ' = local clock.
/.-Source State ' * ' = current synced, ' + ' = combined, '-' = not combined,
| /'? ' = unreachable, ' x ' = time May is in error, ' ~ ' = time too variable.
|| .-xxxx [YYYY] +/-zzzz
|| /xxxx = adjusted offset,
|| LOG2 (Polling interval)-. | yyyy = measured offset,
|| \ | zzzz = Estimated error.
|| | |
MS NAME/IP address stratum Poll Reach Lastrx Last sample
===============================================================================
^? Bogon 0 0 10y +0ns[+0ns] +/-0ns
# # #5. Timedatectl Command # # #
Timedatectl Status # #显示当前时间信息
Set-time HH:mm:ss # #设定当前时间
Set-timezone # #设定当前时区
SET-LOCAL-RTC 0|1 # #设定是否使用utc时间
This article from "12100661" blog, declined reprint!
10 Unit Supplement: Time synchronization