选择皮肤
jiang
2023-12-20 04:41:12
jiang\n楼主
事因:因为某台服务器上面时间和实际时间差了将近一分钟(可以使用 date 命令查看时间)。CentOS 上常用的时间同步是 ntpdate,但是这台服务器一直报 no server suitable for synchronization found,无奈放弃。

不过好在还可以使用 rdate 同步。

jiang
2023-12-20 04:41:45
jiang\n楼主

安装 rdate

使用如下命令安装
yum install rdate
jiang
2023-12-20 04:42:50
jiang\n楼主

rdate 用法

rdate [-p] [-s] [-u] [-l] [-t sec] [host…]
选项
-p     Print the time returned by the remote machine.
 
-s     Set the system time to the returned time.
 
-u     Use UDP instead of TCP as the transport.
 
-l     Use syslog to output errors (cron.warning) and output (cron.info).
 
-t     Set timeout in seconds for every attempt to retrieve date.

使用 man rdate 可以查看

jiang
2023-12-20 04:43:21
jiang\n楼主

rdate同步时间

rdate -s time-b.nist.gov