解决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

再次执行上述修复命令

这样就哦了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值