Prometheus出现此错误失败:
Aug 04 11:27:36 rockpi prometheus[12548]: level=info ts=2020-08-04T11:27:36.098Z caller=main.go:549 msg="Scrape discovery manager stopped"
Aug 04 11:27:36 rockpi prometheus[12548]: level=info ts=2020-08-04T11:27:36.098Z caller=manager.go:888 component="rule manager" msg="Stopping rule manager..."
Aug 04 11:27:36 rockpi prometheus[12548]: level=info ts=2020-08-04T11:27:36.098Z caller=main.go:583 msg="Scrape manager stopped"
Aug 04 11:27:36 rockpi prometheus[12548]: level=info ts=2020-08-04T11:27:36.098Z caller=manager.go:898 component="rule manager" msg="Rule manager stopped"
Aug 04 11:27:36 rockpi prometheus[12548]: level=info ts=2020-08-04T11:27:36.099Z caller=main.go:563 msg="Notify discovery manager stopped"
Aug 04 11:27:36 rockpi prometheus[12548]: level=info ts=2020-08-04T11:27:36.099Z caller=notifier.go:601 component=notifier msg="Stopping notification manager..."
Aug 04 11:27:36 rockpi prometheus[12548]: level=info ts=2020-08-04T11:27:36.099Z caller=main.go:755 msg="Notifier manager stopped"
Aug 04 11:27:36 rockpi prometheus[12548]: level=error ts=2020-08-04T11:27:36.100Z caller=main.go:764 err="opening storage failed: mmap files, file: /var/lib/prometheus/chunks_head/000022: mmap: invalid argument"
Aug 04 11:27:36 rockpi systemd[1]: prometheus.service: Main process exited, code=exited, status=1/FAILURE
Aug 04 11:27:36 rockpi systemd[1]: prometheus.service: Failed with result 'exit-code'.
所以我发现下面是导致错误的原因,但怎么回事?
--storage.tsdb.path /var/lib/prometheus/
完整命令是:
$ prometheus --config.file /etc/prometheus/prometheus.yml --storage.tsdb.path /var/lib/prometheus/ --web.console.templates=/etc/prometheus/consoles
导致此错误:
panic: Unable to create mmap-ed active query log
goroutine 1 [running]:
github.com/prometheus/prometheus/promql.NewActiveQueryTracker(0x7fe5c48690, 0x14, 0x14, 0x2964a00, 0x400087dc20, 0x2964a00)
/app/promql/query_logger.go:117 +0x38c
main.main()
/app/cmd/prometheus/main.go:374 +0x44c8
我该如何解决?
答案 0 :(得分:0)
我遇到了同样的问题,只是倒空了chunks_head
:
sudo rm -rf /var/lib/prometheus/chunks_head/
此后,服务似乎启动正常,数据看起来正常。我不确定这会带来什么影响。