Overview
Currently, native CentOS 8 does not support setting the NTP service. Instead, you need to use chronyd to deliver accurate time. This document describes how to install and configure chronyd on a CentOS 8-based Tencent Cloud CVM instance.
Directions
Installing and configuring the chronyd service
2. Run the following command to install the chronyd service.
3. Run the following command to modify the chrony.conf
configuration file.
4. Press i to enter the edit mode, and append the following content to the next line of #log measurements statistics tracking
.
server time1.tencentyun.com iburst
server time2.tencentyun.com iburst
server time3.tencentyun.com iburst
server time4.tencentyun.com iburst
server time5.tencentyun.com iburst
The result should be as follows:
5. Press Esc and enter :wq to save and close the file.
6. Run the following commands in sequence to enable chronyd autostart and restart it.
systemctl restart chronyd
Verifying the configurations
1. Run the following command to check whether the clock is synced.
2. Run the following command to check the clock source status.
If a result similar to the following is returned, the configuration was successful.
Appendix
Commands
|
chronyc sources -v | Check the clock source. |
chronyc sourcestats -v | Check the clock source status. |
timedatectl set-local-rtc 1 | Set the real time clock. The default format is UTC. |
timedatectl set-ntp yes | Enable the NTP service for synchronization. |
chronyc tracking | Calibrate the NTP server. |
chronyc -a makestep | Force synchronization of the system clock. |
Was this page helpful?