背景: Linux系统时间可能有错误或错误。 在这种情况下,可以在ntpdate中同步更新Linux系统时间。
步骤: (1)安装ntpdate
[ root @ serve r01~] # ntpdate-bash : ntpdate : command not found [ root @ serve r01~] # [ root @ serve r01~]
[ root @ serve r01~] # ntpdate NTP1. a liyun.com 6a ug 14336038336039 ntpdate [ 19389 ] : step time server 120.25.1115.20
AlibabaCloud (阿里巴巴云)提供7个NTP时间服务器。
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com
另请参阅https://help.a liyun.com/document _ detail/92704.html,了解NTP时间服务器的官方地址
)3) data查看系统的当前时间、软件的时间
[ root @ serve r01~] # datefriaug 614336038336054 CST 2021 (4) hwclock -r查看硬件时间、BIOS时间
[ root @ serve r01~] #使hwclock-rfr i06 aug 20210:06336034 pm CST-1.008485 seconds (5) hwclock -w软件时间与硬件时间同步
也可以通过[root@server01 ~]# hwclock -w或命令hwclock --systohc进行同步。
[ root @ serve r01~~ ] # hwclock-- systohc