解决gitlab-ce prometheus 无法启动

gitlab-ce用了几天后无法正常连接

gitlab-ctl tail 发现日志中有

2017-08-27_20:04:18.78566 time="2017-08-27T22:04:18+02:00" level=info msg="Starting prometheus (version=, branch=, revision=)" source="main.go:88"
2017-08-27_20:04:18.78574 time="2017-08-27T22:04:18+02:00" level=info msg="Build context (go=go1.8.1, user=, date=)" source="main.go:89"
2017-08-27_20:04:18.79143 time="2017-08-27T22:04:18+02:00" level=info msg="Loading configuration file /var/opt/gitlab/prometheus/prometheus.yml" source="main.go:251"
2017-08-27_20:04:18.79395 time="2017-08-27T22:04:18+02: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"
2017-08-27_20:04:18.79397 time="2017-08-27T22:04:18+02:00" level=error msg="Error opening memory series storage: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-000521]" source="main.go:191"

这样的问题
可以尝试使用以下方法解决

先尝试使用

gitlab-ctl restart prometheus

如果没有解决再尝试以下办法

sudo -u gitlab-prometheus python -c "import leveldb; leveldb.RepairDB('/var/opt/gitlab/prometheus/data/archived_fingerprint_to_metric')"

执行完成之后就可以重新启动 prometheus
上述命令要求服务器安装python2.7
如果没有安装是不可运行的,不了解python的同学可以依次使用以下命令

apt-get install python
apt-get install python-pip
pip install leveldb

再次执行上述修复命令

这样就哦了。

猜你喜欢

转载自blog.csdn.net/StillCity/article/details/78721611
今日推荐