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

再次执行上述修复命令

这样就哦了。

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐