NTP
NTP 服务配置和设置
Rocky LInux 设置NTP
安装
dnf install chrony
systemctl enable --now chronyd
配置
vim /etc/chrony.conf
pool ntp1.aliyun.com iburst
pool ntp.tencent.com iburst
pool ntp1.bce.baidu.com iburst
重启
systemctl restart chronyd
设置硬件时钟
#启用或者禁用NTP时间同步,以硬件时钟为准
#启用
timedatectl set-ntp true
#禁用
timedatectl set-ntp false
查看时钟
timedatectl status
#例子
timedatectl
Local time: Tue 2024-12-03 11:18:25 HKT
Universal time: Tue 2024-12-03 03:18:25 UTC
RTC time: Tue 2024-12-03 03:18:25
Time zone: Asia/Hong_Kong (HKT, +0800)
System clock synchronized: yes #同步
NTP service: active #NTP服务激活
RTC in local TZ: no
#查看时区设置
timedatectl show
修改时区
#查看时区
timedatectl list-timezones
#设置时区
timedatectl set-timezone Asia/Shanghai