• Prometheus断电后启动异常 Error on ingesting samples


    Prometheus断电后启动异常 Error on ingesting samples that are too old or are too far into the future

    国庆假期回来后,发现 Prometheus 服务启动后没数据,查看日志

    level=warn ts=2020-10-09T02:29:06.700Z caller=scrape.go:1216 component="scrape manager" scrape_pool=service.server target=http://192.168.1.22:9100/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=929
    level=warn ts=2020-10-09T02:29:06.700Z caller=scrape.go:987 component="scrape manager" scrape_pool=service.server target=http://192.168.1.22:9100/metrics msg="appending scrape report failed" err="out of bounds"
    

    日志的时间戳与当前时间戳提前了8个小时: level=warn ts=2020-10-09T02:29:06.700Z

    可能是国庆服务器长时间断电导致的 tsdb 记录日期太旧。

    解决方法:

    prometheus 版本:2.16.0
    操作系统:CentOS 7.6
    
    # 创建一个新的 tsdb 数据目录
    mkdir /root/prometheus-2.16.0/tsdb_data/
    
    # 启动时指定 tsdb 数据目录为刚刚创建的
    /root/prometheus-2.16.0/prometheus 
    --config.file="/root/prometheus-2.16.0/prometheus.yml" 
    --storage.tsdb.path="/root/prometheus-2.16.0/tsdb_data" 
    --web.enable-lifecycle 
    --web.enable-admin-api &
  • 相关阅读:
    JS实现在线ps功能
    Vmware 下安装linux虚拟机
    一文了解:Redis主从复制
    一文了解:Redis过期键删除策略
    一文了解:Redis的AOF持久化
    一文了解:Redis的RDB持久化
    一文了解:Redis事务
    一文了解:Redis基础类型
    并发一:Java内存模型和Volatile
    干了这杯java之ThreadLocal
  • 原文地址:https://www.cnblogs.com/cheyunhua/p/14443823.html
Copyright © 2020-2023  润新知