Prometheus-08 安装配置prometheus时的ntp时间同步问题

prometheus需要本地时间与容器时间一致,首先检查本地时间,输入date查看本地时间,设置本地主机的时区和时间

[root@maste prometheus]# date
Fri Jun 23 20:36:51 CST 2023

查看时区

[root@maste prometheus]# timedatectl
      Local time: Fri 2023-06-23 04:16:30 UTC
  Universal time: Fri 2023-06-23 04:16:30 UTC
        RTC time: Fri 2023-06-23 04:16:30
       Time zone: UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

在输出结果中,找到 “Time zone” 行,确认当前的时区设置。

设置时区
sudo timedatectl set-timezone Asia/Shanghai

安装配置ntp

centos安装ntp

安装NTP软件包(如果尚未安装):
yum -y install ntp

启用并启动NTP服务:
sudo systemctl enable ntpd
sudo systemctl start ntpd

验证NTP服务是否正常运行:
sudo systemctl status ntpd

确认NTP服务开机自启已启用:
sudo systemctl is-enabled ntpd

1:手动同步NT

猜你喜欢

转载自blog.csdn.net/huanglu0314/article/details/131354014
今日推荐