查看系统当前时间:
[root@localhost ~]# date -R
查看当前时区:
客户端同步NTP时间:
[root@localhost ~]# yum -y install ntp
[root@localhost ~]# vim /etc/ntp.conf 增加ntp服务器的server,注释掉默认server服务
# Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).server *.9.9.122 iburst# server 0.centos.pool.ntp.org iburst# server 1.centos.pool.ntp.org iburst# server 2.centos.pool.ntp.org iburst# server 3.centos.pool.ntp.org iburst
[root@localhost ~]# systemctl start ntpd
[root@localhost ~]# systemctl enable ntpd
[root@localhost ~]# systemctl status ntpd
查看服务器同级设备列表:
[root@localhost ~]# ntpq -p
同步系统时间至硬件:
[root@localhost ~]# hwclock —systohc
