今天安装redis时,发现服务器时间不对,早上时间10点,服务器显示时间18点

[root@localhost redis-4.0.14]# date
2020年 09月 25日 星期五 18:15:18 CST

安装ntp进行时间校准

yum -y install ntp

测试并校准ntp时间

ntpdate pool.ntp.org

查看服务时间

[root@localhost redis-4.0.14]# date
2020年 09月 25日 星期五 10:16:22 CST

可以看到,时间校准成功

启动ntp,持续校准时间

systemctl start ntpd

查看ntp是否启动

 systemctl status ntpd

 [root@localhost redis-4.0.14]# systemctl status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
   Active: active (running) since 五 2020-09-25 10:16:29 CST; 6min ago
  Process: 30336 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 30340 (ntpd)
    Tasks: 1
   CGroup: /system.slice/ntpd.service
           └─30340 /usr/sbin/ntpd -u ntp:ntp -g

9月 25 10:16:29 localhost.localdomain ntpd[30340]: Listen normally on 5 virb...
9月 25 10:16:29 localhost.localdomain ntpd[30340]: Listen normally on 6 lo :...
9月 25 10:16:29 localhost.localdomain ntpd[30340]: Listen normally on 7 enp3...
9月 25 10:16:29 localhost.localdomain ntpd[30340]: Listen normally on 8 enp3...
9月 25 10:16:29 localhost.localdomain ntpd[30340]: Listening on routing sock...
9月 25 10:16:29 localhost.localdomain systemd[1]: Started Network Time Service.
9月 25 10:16:30 localhost.localdomain ntpd[30340]: 0.0.0.0 c016 06 restart
9月 25 10:16:30 localhost.localdomain ntpd[30340]: 0.0.0.0 c012 02 freq_set ...
9月 25 10:16:30 localhost.localdomain ntpd[30340]: 0.0.0.0 c011 01 freq_not_set
9月 25 10:16:36 localhost.localdomain ntpd[30340]: 0.0.0.0 c614 04 freq_mode
Hint: Some lines were ellipsized, use -l to show in full.