Linux|错误集锦|prometheus Error on ingesting samples that are too old or are too far into the future的解决

本文涉及的产品
可观测监控 Prometheus 版,每月50GB免费额度
简介: Linux|错误集锦|prometheus Error on ingesting samples that are too old or are too far into the future的解决

前情回顾:

二进制prometheus部署完成后,在prometheus的web界面进行一些数据验证工作。

下面这个是我已经恢复正常的,其实是查询不到数据的

 

grafana也接收不到任何数据

问题排查:

查看系统日志 /var/log/messages ,有很多飘红,内容如下:

2023-03-05T10:04:43.421936+08:00 EULER1 prometheus: ts=2023-03-05T02:04:43.420Z caller=scrape.go:1604 level=warn component="scrape manager" scrape_pool=prometheus target=http://192.168.123.60:39090/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=585
2023-03-05T10:04:43.422722+08:00 EULER1 prometheus: ts=2023-03-05T02:04:43.420Z caller=scrape.go:1338 level=warn component="scrape manager" scrape_pool=prometheus target=http://192.168.123.60:39090/metrics msg="Append failed" err="out of bounds"
2023-03-05T10:04:46.332122+08:00 EULER1 prometheus: ts=2023-03-05T02:04:46.331Z caller=scrape.go:1604 level=warn component="scrape manager" scrape_pool=server target=http://192.168.123.60:39100/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=489
2023-03-05T10:04:46.332823+08:00 EULER1 prometheus: ts=2023-03-05T02:04:46.331Z caller=scrape.go:1338 level=warn component="scrape manager" scrape_pool=server target=http://192.168.123.60:39100/metrics msg="Append failed" err="out of bounds"
2023-03-05T10:04:53.220008+08:00 EULER1 grafana: logger=context userId=1 orgId=1 uname=admin t=2023-03-05T10:04:53.218709394+08:00 level=info msg="Request Completed" method=GET path=/api/live/ws status=-1 remote_addr=192.168.123.1 time_ms=34 duration=34.438488ms size=0 referer= handler=/api/live/ws
2023-03-05T10:04:58.421342+08:00 EULER1 prometheus: ts=2023-03-05T02:04:58.420Z caller=scrape.go:1604 level=warn component="scrape manager" scrape_pool=prometheus target=http://192.168.123.60:39090/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=585
2023-03-05T10:04:58.422096+08:00 EULER1 prometheus: ts=2023-03-05T02:04:58.420Z caller=scrape.go:1338 level=warn component="scrape manager" scrape_pool=prometheus target=http://192.168.123.60:39090/metrics msg="Append failed" err="out of bounds"
2023-03-05T10:05:01.324456+08:00 EULER1 prometheus: ts=2023-03-05T02:05:01.323Z caller=scrape.go:1604 level=warn component="scrape manager" scrape_pool=server target=http://192.168.123.60:39100/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=489
2023-03-05T10:05:01.324838+08:00 EULER1 prometheus: ts=2023-03-05T02:05:01.323Z caller=scrape.go:1338 level=warn component="scrape manager" scrape_pool=server target=http://192.168.123.60:39100/metrics msg="Append failed" err="out of bounds"
2023-03-05T10:05:13.423583+08:00 EULER1 prometheus: ts=2023-03-05T02:05:13.422Z caller=scrape.go:1604 level=warn component="scrape manager" scrape_pool=prometheus target=http://192.168.123.60:39090/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=585
2023-03-05T10:05:13.424362+08:00 EULER1 prometheus: ts=2023-03-05T02:05:13.422Z caller=scrape.go:1338 level=warn component="scrape manager" scrape_pool=prometheus target=http://192.168.123.60:39090/metrics msg="Append failed" err="out of bounds"
2023-03-05T10:05:16.330791+08:00 EULER1 prometheus: ts=2023-03-05T02:05:16.329Z caller=scrape.go:1604 level=warn component="scrape manager" scrape_pool=server target=http://192.168.123.60:39100/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=489

以上报错的意思是由于时间不正常,时序数据库出现异常。

查看系统时间,是正常的,并且已经同步过阿里云的时间服务器,同步命令如下:

[root@EULER1 tsdb_data]# ntpdate ntp.aliyun.com
11 Mar 20:08:29 ntpdate[53501]: adjust time server 203.107.6.88 offset 0.001621 sec

整个就是无语,完全没有想法的状态。

解决方案:

后面仔细考虑了一下部署前后的操作,其中有一个细节,是prometheus server服务启动后,查看了服务状态,确认状态正常后,又修改了时区,因为系统时间不知道怎么回事,又回到了西八区,因此,再次改为东八区,命令如下:

rm -rf /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

最终确定是由于时区更改的问题,造成prometheus的时序数据库出现数据异常,因此需要重置prometheus的时序数据库。

最终解决方案:

 cat >/etc/systemd/system/prometheus.service <<EOF
[Unit]
Descriptinotallow=Prometheus Monitoring System
Documentatinotallow=Prometheus Monitoring System
[Service]
ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --web.listen-address=:39090 \
--storage.tsdb.path="/opt/prometheus/tsdb_data"
# 这里的路径按实际填写
[Install]
WantedBy=multi-user.target
EOF

启动脚本内增加了--storage.tsdb.path="/opt/prometheus/tsdb_data"  /opt/prometheus/tsdb_data目录需要新建

再次重启prometheus服务后,发现一切恢复正常。

虽然prometheus的数据仍然是存放在/data 目录下,并不在/opt/prometheus/tsdb_data目录下,但神奇的是prometheus服务竟然恢复了。具体原因还不清楚,留待以后在研究吧。

相关实践学习
容器服务Serverless版ACK Serverless 快速入门:在线魔方应用部署和监控
通过本实验,您将了解到容器服务Serverless版ACK Serverless 的基本产品能力,即可以实现快速部署一个在线魔方应用,并借助阿里云容器服务成熟的产品生态,实现在线应用的企业级监控,提升应用稳定性。
目录
相关文章
|
6月前
|
Kubernetes Java Linux
Linux|操作系统|Error: Could not create the Java Virtual Machine 报错的解决思路
Linux|操作系统|Error: Could not create the Java Virtual Machine 报错的解决思路
1445 0
|
2月前
|
Oracle Java 关系型数据库
Linux下JDK环境的配置及 bash: /usr/local/java/bin/java: cannot execute binary file: exec format error问题的解决
如果遇到"exec format error"问题,文章建议先检查Linux操作系统是32位还是64位,并确保安装了与系统匹配的JDK版本。如果系统是64位的,但出现了错误,可能是因为下载了错误的JDK版本。文章提供了一个链接,指向Oracle官网上的JDK 17 Linux版本下载页面,并附有截图说明。
Linux下JDK环境的配置及 bash: /usr/local/java/bin/java: cannot execute binary file: exec format error问题的解决
|
3月前
|
Ubuntu Linux 编译器
在ubantu/linux系统出现parse error(语法错误)
本文讨论了在Ubuntu/Linux系统中遇到"parse error"(语法错误)的问题,并提供了将非声明语句移动到所有声明语句下方以解决该问题的解决方案。
在ubantu/linux系统出现parse error(语法错误)
|
3月前
|
Java Linux Shell
【Azure 应用服务】部署Jar到App Service for Linux,因启动命令路径配置错误而引起:( Application Error 问题
【Azure 应用服务】部署Jar到App Service for Linux,因启动命令路径配置错误而引起:( Application Error 问题
|
3月前
|
Prometheus 监控 Cloud Native
在Linux中,如何使用Grafana和Prometheus进行网络监控和可视化?
在Linux中,如何使用Grafana和Prometheus进行网络监控和可视化?
|
3月前
|
Oracle Java 关系型数据库
简单记录在Linux上安装JDK环境的步骤,以及解决运行Java程序时出现Error Could not find or load main class XXX问题
本文记录了在Linux系统上安装JDK环境的步骤,并提供了解决运行Java程序时出现的"Error Could not find or load main class XXX"问题的方案,主要是通过重新配置和刷新JDK环境变量来解决。
126 0
|
5月前
|
Unix Docker 容器
使用docker 启动naocs 报错出现:standard_init_linux.go:241: exec user process caused "exec format error"
```markdown Error in Docker container startup: &quot;standard_init_linux.go:241: exec user process caused \&quot;exec format error\&quot;&quot;. Occurred at 2024-06-29 09:26:19.910, followed by a failed hook with a syslog delivery error at 09:27:20.193. Seeking solutions from experts. ```
|
6月前
Receiving ASM traces for errors: ORA-27090, LINUX-X86_64 ERROR: 17
Receiving ASM traces for errors: ORA-27090, LINUX-X86_64 ERROR:
44 7
|
6月前
|
Linux 固态存储
linux ext4-fs error,[求助]EXT4-fs error (device sdb4) ext4_find_entry
linux ext4-fs error,[求助]EXT4-fs error (device sdb4) ext4_find_entry
linux ext4-fs error,[求助]EXT4-fs error (device sdb4) ext4_find_entry
|
6月前
|
Prometheus 监控 Cloud Native
Linux|centos二进制方式安装系统和网络监控神器prometheus+grafana(装逼神器它来了)(基础篇 一)
Linux|centos二进制方式安装系统和网络监控神器prometheus+grafana(装逼神器它来了)(基础篇 一)
293 0
下一篇
无影云桌面