![GitLab 和 Prometheus 失败](https://linux22.com/image/716892/GitLab%20%E5%92%8C%20Prometheus%20%E5%A4%B1%E8%B4%A5.png)
设置:GitLab安装有综合包装CentOS6.4
在 GitLab 配置文件 /etc/gitlab/gitlab.rb 中做出更改以将 Bitbucket 配置为 OAuth2 提供程序后,我运行了重新配置:
sudo gitlab-ctl reconfigure
启动此命令后,我看到了一些错误,可能是关于监控服务的错误,但 SSH 会话中断了,我还没看到发生了什么。恢复会话后,GitLab 无法访问,我能看到 GitLab 徽标,但出现 502 错误:“GitLab 响应时间过长“或类似的东西。
因此我恢复了配置文件,认为其中存在问题......
运行 tail 时出现以下错误(Prometheus 失败):
2018-01-30_22:19:19.28021 time="2018-01-30T23:19:19+01:00" level=info msg="Starting prometheus (version=, branch=, revision=)" source="main.go:87"
2018-01-30_22:19:19.28027 time="2018-01-30T23:19:19+01:00" level=info msg="Build context (go=go1.9.2, user=, date=)" source="main.go:88"
2018-01-30_22:19:19.28030 time="2018-01-30T23:19:19+01:00" level=info msg="Host details (Linux 2.6.32-642.11.1.el6.x86_64 #1 SMP Fri Nov 18 19:25:05 UTC 2016 x86_64 lnx01.brainsen.com (none))" source="main.go:89"
2018-01-30_22:19:19.29486 time="2018-01-30T23:19:19+01:00" level=info msg="Loading configuration file /var/opt/gitlab/prometheus/prometheus.yml" source="main.go:254"
2018-01-30_22:19:19.29779 time="2018-01-30T23:19:19+01:00" level=error msg="Could not open the fingerprint-to-metric index for archived series. Please try a 3rd party tool to repair LevelDB in directory "/var/opt/gitlab/prometheus/data/archived_fingerprint_to_metric". If unsuccessful or undesired, delete the whole directory and restart Prometheus for crash recovery. You will lose all archived time series." source="persistence.go:213"
2018-01-30_22:19:19.29781 time="2018-01-30T23:19:19+01:00" level=error msg="Error opening memory series storage: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-000923]" source="main.go:192"
我已经运行了命令
sudo -u gitlab-prometheus python -c "import leveldb; leveldb.RepairDB('/var/opt/gitlab/prometheus/data/archived_fingerprint_to_metric')"
但我收到了消息:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named leveldb
现在 GitLab 运行良好,但运行尾部时我仍然每 2 秒看到一次有关 Prometheus 的上述错误,我想在不破坏我的 GitLab 安装的情况下修复它。
答案1
问题是 gitlab 在 pyvenv 设置中运行 Prometheus,但我找不到它在哪里。
您可以随时
pip install leveldb
然后运行命令..它应该可以工作