prometheus 服务器重启后之"Error on ingesting samples that are too old or are too far into the future"问题解决

摘要:
背景描述:aws中的prometheus实例状态检查异常。重新启动实例后,实例正常。此时,发现grafana中的主机是空的。检查日志后发现:level=warnts=2021-08-16T03:20:04.960Zcaller=scraper。go:1507component=“scraper”_ pool=mtailtarget=http://18.167.146.20:3903

背景描述:aws中的prometheus实例状态检查出现异常,重启实例后实例正常,此时发现grafana中主机为空,经查看日志发现如下:

level=warn ts=2021-08-16T03:20:04.960Z caller=scrape.go:1507 component="scrape manager" scrape_pool=mtail target=http://18.167.146.20:3903/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=78
level=warn ts=2021-08-16T03:20:04.961Z caller=scrape.go:1203 component="scrape manager" scrape_pool=mtail target=http://18.167.146.20:3903/metrics msg="Appending scrape report failed" err="out of bounds"
level=warn ts=2021-08-16T03:20:06.868Z caller=scrape.go:1507 component="scrape manager" scrape_pool=node target=http://18.166.55.107:9100/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=491
level=warn ts=2021-08-16T03:20:06.868Z caller=scrape.go:1203 component="scrape manager" scrape_pool=node target=http://18.166.55.107:9100/metrics msg="Appending scrape report failed" err="out of bounds"
level=warn ts=2021-08-16T03:20:08.140Z caller=scrape.go:1507 component="scrape manager" scrape_pool=mysql-mater-slave-luxe target=http://18.166.83.165:9104/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=959
level=warn ts=2021-08-16T03:20:08.140Z caller=scrape.go:1203 component="scrape manager" scrape_pool=mysql-mater-slave-luxe target=http://18.166.83.165:9104/metrics msg="Appending scrape report failed" err="out of bounds"
level=warn ts=2021-08-16T03:20:09.037Z caller=scrape.go:1507 component="scrape manager" scrape_pool=mysql-mater-slave-luxe target=http://16.162.107.109:9104/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=941
level=warn ts=2021-08-16T03:20:09.037Z caller=scrape.go:1203 component="scrape manager" scrape_pool=mysql-mater-slave-luxe target=http://16.162.107.109:9104/metrics msg="Appending scrape report failed" err="out of bounds"
level=warn ts=2021-08-16T03:20:09.960Z caller=scrape.go:1507 component="scrape manager" scrape_pool=mtail target=http://18.167.146.20:3903/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=78
level=warn ts=2021-08-16T03:20:09.960Z caller=scrape.go:1203 component="scrape manager" scrape_pool=mtail target=http://18.167.146.20:3903/metrics msg="Appending scrape report failed" err="out of bounds"
level=warn ts=2021-08-16T03:20:10.168Z caller=scrape.go:1507 component="scrape manager" scrape_pool=prometheus target=http://18.166.55.107:9090/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=558
level=warn ts=2021-08-16T03:20:10.168Z caller=scrape.go:1203 component="scrape manager" scrape_pool=prometheus target=http://18.166.55.107:9090/metrics msg="Appending scrape report failed" err="out of bounds"

解决方法:

备份prometheus数据库,新建data目录,重启prometheus和grafana服务
[root@prometheus /opt/prometheus]# mv data/ data_bak
[root@prometheus /opt/prometheus]# mkdir -pv data && chown -R prometheus.prometheus data
[root@prometheus /opt/prometheus]# systemctl restart prometheus
[root@prometheus /opt/prometheus]# systemctl restart grafana-server
web界面访问prometheus正常,grafana访问正常

免责声明:文章转载自《prometheus 服务器重启后之"Error on ingesting samples that are too old or are too far into the future"问题解决》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇【javascript】浅析js中的堆和栈CSS拾遗下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

unable to recognize "*.yaml": no matches for kind "RoleBinding" in version "rbac.authorization.k8s.io/v1beta1"

问题的原因为资源文件的版本定义过期了。需要修改下 ┌──[root@vms81.liruilongs.github.io]-[~/ansible/metrics/deploy/1.8+] └─$kubectl apply -f . clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics...

使用Prometheus监控snmp

获取snmp信息 首先获取需要监控的snmp的基本信息,假设基本信息如下: snmp服务IP: 1.1.1.1 snmp community: public snmp exportor部署地址: 2.2.2.2 配置snmp exporter 从官方下载snmp exporter的可执行文件。 此外还需要自己编译生成snmp exporter的配置文件,...

修改prometheus默认端口,修改grafana默认端口

修改prometheus的默认端口 进入prometheus目录,编辑prometheus.yml文件 在prometheus.yml路径中,运行命令 #启动prometheus./prometheus --config.file=prometheus.yml --web.listen-address=:8001 & 修改gr...

Prometheus介绍及二进制部署(一)

一、Prometheus是什么 Prometheus是什么Prometheus(普罗米修斯)是一个最初在SoundCloud上构建的监控系统。自2012年成为社区开源项目,拥有非常活跃的开发人员和用户社区。为强调开源及独立维护,Prometheus于2016年加入云原生云计算基金会(CNCF),成为继Kubernetes之后的第二个托管项目。 https:...

docker swarm 部署 prometheus 用于监控服务器

compose.yml version: "3" services: prometheus: image: prom/prometheus:v2.18.1 ports: - "9090:9090" volumes: - /var/prometheus/etc:/etc/prometheus...

Prometheus监控学习笔记之360基于Prometheus的在线服务监控实践

0x00 初衷 最近参与的几个项目,无一例外对监控都有极强的要求,需要对项目中各组件进行详细监控,如服务端API的请求次数、响应时间、到达率、接口错误率、分布式存储中的集群IOPS、节点在线情况、偏移量等。 比较常见的方式是写日志,将日志采集到远端进行分析和绘图,或写好本地监控脚本进行数据采集后,通过监控系统客户端push到监控系统中进行打点。基本上我们需...