Prometheus断电启动异常

一、Prometheus启动后没有数据,查看日志

  • 日志的时间戳与当前时间戳不一致。
level=warn ts=2021-09-05T08:11:56.003Z caller=scrape.go:1380 component="scrape manager" scrape_pool=prometheus target=http://localhost:9090/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=317
level=warn ts=2021-09-05T08:11:56.003Z caller=scrape.go:1096 component="scrape manager" scrape_pool=prometheus target=http://localhost:9090/metrics msg="Appending scrape report failed" err="out of bounds"

在这里插入图片描述

  • 解决办法
  • 1 重新创建一个目录
[root@Ansible01 ~]# cd /usr/local/Prometheus
[root@Ansible01 Prometheus]# ls
console_libraries  consoles  LICENSE  NOTICE  prometheus  prometheus.yml  promtool
[root@Ansible01 Prometheus]# mkdir data
[root@Ansible01 Prometheus]# /usr/local/Prometheus/prometheus --config.file=/usr/local/Prometheus/prometheus.yml --storage.tsdb.path=/usr/local/Prometheus/data 
  • 2 删除data日志

注: 这个data目录是因为/usr/local/Prometheus/prometheus --config.file=/usr/local/Prometheus/prometheus.yml 命令执行后 /usr/local/路径下与Prometheus平

[root@Ansible01 Prometheus]# cd ../data/
[root@Ansible01 data]# ls
chunks_head  lock  queries.active  wal
[root@Ansible01 data]# cd ..
[root@Ansible01 local]# ls
bin  data  etc  games  include  lib  lib64  libexec  Prometheus  sbin  share  src
[root@Ansible01 local]# rm -rf data/
[root@Ansible01 local]# ls
bin  etc  games  include  lib  lib64  libexec  Prometheus  sbin  share  src
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值