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.
Run the following command to install the chronyd service.
yum -y install chrony
Run the following command to modify the
chrony.conf configuration file.
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
systemctl enable chronyd
Run the following command to check whether the clock is synced.
Run the following command to check the clock source status.
chronyc sourcestats -v
If a result similar to the following is returned, the configuration was successful.
||Check the clock source.|
||Check the clock source status.|
||Set the real time clock. The default format is UTC.|
||Enable the NTP service for synchronization.|
||Calibrate the NTP server.|
||Force synchronization of the system clock.|