問題
向MinIO上傳文件時,拋出異常:The difference between the request time and the server's time is too large.
使用date命令修改CentOS時間后,異常依然存在。
相關Linux命令
查看系統時間:date
查看硬件時間:hwclock
原因
只修改了系統時間,硬件時間未修改。
解決方法
方法1
1. 手動修改系統時間
date -s 20210127
date -s 16:01:32
date -s "20210127 16:01:32"
2. 將系統時間寫入硬件時間
hwclock --systohc
方法2
1. 安裝ntp ntpdate
yum -y install ntp ntpdate
2. 與時間服務器同步時間
ntpdate cn.pool.ntp.org
3. 將系統時間寫入硬件時間
hwclock --systohc