#安裝NTP
[root@slave2 ~]# yum install -y ntp
#同步時間,也可以自己搭建ntp服務器
[root@slave2 ~]# ntpdate ntp1.aliyun.com
27 Aug 14:46:20 ntpdate[1562]: step time server 120.25.115.20 offset 8088.377753 sec
#同步虛擬機系統時間和硬件時間
[root@slave2 ~]# hwclock –systohc
#強制把系統時間寫入CMOS:
[root@slave2 ~]# clock -w
#更改時區
# ln -sf /usr/share/zoneinfor/Asia/Shanghai /etc/localtime
#查看
[root@slave2 ~]# date
2019年 08月 27日 星期二 14:46:26 CST