1. 使用ntpdate同步
[root@node ~]# ntpdate ntp.aliyun.com
4 Aug 00:07:17 ntpdate[20924]: adjust time server 203.107.6.88 offset -0.001543 sec
2. 查看时间
[root@node ~]# date
Thu Aug 4 00:07:46 CST 2022
3. 如果时间对不上
报错信息
cna02:~ # ntpdate ntp1.aliyun.com
4 Aug 07:23:41 ntpdate[18694]: the NTP socket is in use, exiting
处理方法
cna02:~ # service ntpd stop
Redirecting to /bin/systemctl stop ntpd.service
重新同步
cna02:~ # ntpdate ntp1.aliyun.com
3 Aug 23:22:36 ntpdate[28980]: step time server 120.25.115.20 offset -28911.609110 sec