1.设置服务器A为时间服务器
vim /etc/ntp.conf
#最后一行加入下面一行,保存退出
server 127.127.1.0
#重启时间服务器
service ntpd restart
2.B服务器同步A服务器的时间
[root@bak-thinkee ~]# systemctl stop ntpd.service
Shutting down ntpd: [ OK ]
#同步A服务器的时间
[root@bak-thinkee ~]# ntpdate <A服务器IP>
25 Mar 14:34:00 ntpdate[36564]: step time server [A服务器IP] offset 860.396593 sec
#查看B机器系统时间
[root@bak-thinkee ~]# date
Thu Mar 25 14:34:57 CST 2021
#查看B机器BIOS硬件时钟时间
[root@bak-thinkee ~]# clock --show
Thu Mar 25 14:20:29 CST 2021
#将系统时间刷入到BIOS时钟里面去
[root@bak-thinkee ~]# hwclock --systohc
#重新查看下硬件时钟时间
[root@bak-thinkee ~]# clock --show
Thu 25 Mar 2021 02:36:55 PM CST -0.750690 seconds