查看时间同步源:
chronyc sources -v
立即手工同步 (本人亲测 到这一步 基本上就同步了 )
chronyc -a makestep
查看时间同步源状态:
chronyc sourcestats -v
设置硬件时间
硬件时间默认为UTC:
timedatectl set-local-rtc 1
启用NTP时间同步:
timedatectl set-ntp yes
校准时间服务器:
chronyc tracking
最后需要注意的是,配置完/etc/chrony.conf后,需重启chrony服务,否则可能会不生效。
最后一步,将当前时间和日期写入BIOS,避免重启后失效
hwclock -w
View the time synchronization source: chronyc sources -v Manual synchronization immediately (I personally tested this step and basically synchronized it)
chronyc -a makestep View time synchronization source status: chronyc sourcestats -v Set hardware time Hardware time defaults to UTC: timedatectl set-local-rtc 1 Enable NTP time synchronization: timedatectl set-ntp yes Calibrate the time server: chronyc tracking Yes, after configuring /etc/chrony.conf, you need to restart the chrony service, otherwise it may not take effect.
The last step is to write the current time and date into the BIOS to avoid failure after restarting hwclock -w