记Kubernetes(k8s):访问 Prometheus UI界面:Warning: Error fetching server time
|-----------------------------|
| 💖The Begin💖点点关注,收藏不迷路💖 |
1、报错详情
Warning: Error fetching server time: Detected 86338.77700018883 seconds time difference between your browser and the server. Prometheus relies on accurate time and time drift might cause unexpected query results.

这个警告表明您的浏览器和服务器之间存在大约 86338.777 秒的时间差异,这可能会影响 Prometheus 查询结果的准确性。Prometheus 需要准确的时间信息来执行查询和聚合操作。
这种时间差异可能是由于服务器的时钟与您的浏览器的时钟之间存在偏差导致的,或者可能是由于网络延迟引起的。
2、解决
1、服务器节点时间查看
[root@k8s-master ~]# date
Sun Apr 7 20:28:11 CST 2024
[root@k8s-master ~]#
2、安装 ntpdate
sql
1、安装 ntpdate
# CentOS/RHEL
sudo yum install ntpdate
# Ubuntu/Debian
sudo apt install ntpdate
3、同步时间
ntpdate ntp.aliyun.com
4、将系统时间同步到硬件时钟(RTC,Real-Time Clock)
sql
hwclock --systohc
3、再次访问 PrometheusUI界面
|---------------------------|
| 💖The End💖点点关注,收藏不迷路💖 |