Prometheus:Warning! Detected 72.65 seconds time difference between your browser and the serve解决方案

在网上查了很多,全是标题党,说一堆,问题没解决,我裂开~~~~

废话不多说,直接看问题(如图): 大致意思就是浏览器和服务器之间存在时间差,Prometheus依赖精确时间,时间差会导致查询到的数据不准确。
在这里插入图片描述
解决方案:

# 1、先看看Prometheus server端的时间
[root@cluster-node-1 prometheus]# date
Thu Jan 28 02:13:18 EST 2021

# 2、再看看你浏览器(电脑)时间,如下图:

在这里插入图片描述

瞧见了吗?差了这么多,不警告才有怪~~~

# 3、确保Prometheus server端能通网
ping www.baidu.com
[root@cluster-node-1 ~]# ping www.baidu.com
PING www.a.shifen.com (220.181.38.149) 56(84) bytes of data.
64 bytes from 220.181.38.149 (220.181.38.149): icmp_seq=1 ttl=50 time=27.0 ms
64 bytes from 220.181.38.149 (220.181.38.149): icmp_seq=2 ttl=50 time=27.7 ms

# 4、安装时间同步
yum -y install ntp

# 5、将时间和阿里云服务同步
ntpdate -u time1.aliyun.com

# 6、到浏览器刷新页面就好了

这里也不一定非得同步到阿里云,你可以找一台已经时间同步好的服务,然后将Prometheus server端和它同步就好了

错误总结:

[root@cluster-node-4 ~]# ping www.baidu.com
ping: www.baidu.com: Name or service not known

# 这个错误是没有配置DNS服务,无法解析www.baidu.com
# 解决方法(配置谷歌DNS):
 echo "nameserver 114.114.114.114" >> /etc/resolv.conf
 echo "nameserver 8.8.8.8" >> /etc/resolv.conf
[root@cluster-node-1 prometheus]# systemctl restart network
[root@cluster-node-1 prometheus]# ntpdate -u 192.168.XXX.XXX
28 Jan 02:21:50 ntpdate[31891]: no server suitable for synchronization found

#这个错误是你同步的服务器没装时间同步ntp服务或者就是没起来
# 解决方法 :
1、先看看有没有ntp服务
[root@cluster-node-1 ~]# ps -ef | grep ntpd
ntp      107975      1  0 10:23 ?        00:00:00 /usr/sbin/ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root     118567 107884  0 11:08 pts/1    00:00:00 grep --color=auto ntpd
2、有的话就重启一下
[root@cluster-node-1 ~]# systemctl restart ntpd
3、没有就装一个再重启一下
[root@cluster-node-1 ~]# yum -y install ntp
[root@cluster-node-1 ~]# systemctl restart ntpd

说给自己的话:学东西不能仅依靠度娘,知其然,知其所以然才能更好的进步~

  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值