時間同步
1.服務端
yum install chrony -y ##安裝服務
vim /etc/chrony.conf ##主配置文件
21 # Allow NTP client access from local network.
22 allow 172.25.0.0/24 ##允許誰去同步我的時間
28 # Serve time even if not synchronized to any NTP server.
29 local stratum 10 ##不去同步任何人的時間,時間同步服務器級別
systemctl restart chronyd
systemctl stop firewalld
2.客戶端
vim /etc/chrony.conf
3 server 0.rhel.pool.ntp.org iburst
4 server 1.rhel.pool.ntp.org iburst====> server ntpserverip iburst
5 server 2.rhel.pool.ntp.org iburst====>
6 server 3.rhel.pool.ntp.org iburst
systemctl restart chronyd
[root@localhost ~]# chronyc sources -v
timedatectl命令
timedatectl status ##顯示當前時間信息
timedatectl set-time ##設定當前時間
timedatectl set-local-rtc 0|1 ##設定是否使用utc時間