Gitlab

Gitlab Omnibus 中沒有普羅米修斯

  • February 3, 2019

設置: Ubuntu 14.04 以及所有最新更新,

Gitlab Omnibus 版本 11.7.3(最新)

~$ sudo grep prometheus /etc/gitlab/gitlab.rb

prometheus_monitoring['enable'] = true
prometheus['enable'] = true
prometheus['listen_address'] = ':9090'

問題 - 瀏覽器無法連接到http://localhost:9090,並且日誌為空。

$ curl http://localhost:9090
curl: (7) Failed to connect to localhost port 9090: Connection refused

$ sudo gitlab-ctl tail prometheus
==> /var/log/gitlab/prometheus/state <==

==> /var/log/gitlab/prometheus/current <==

sudo netstat -tunlp不顯示埠 9090

但是,prometheus 程序似乎正在執行:

$ ps ax | grep prometheus
1358 ?        Ss     6:32 runsv prometheus
1377 ?        S      0:35 svlogd -tt /var/log/gitlab/prometheus
6935 ?        Ssl    0:02 /opt/gitlab/embedded/bin/gitlab-workhorse -listenNetwork unix -listenUmask 0 -listenAddr /var/opt/gitlab/gitlab-workhorse/socket -authBackend http://localhost:8080 -authSocket /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket -documentRoot /opt/gitlab/embedded/service/gitlab-rails/public -pprofListenAddr  -prometheusListenAddr localhost:9229 -secretPath /opt/gitlab/embedded/service/gitlab-rails/.gitlab_workhorse_secret -config config.toml
25394 pts/0    S+     0:00 grep --color=auto prometheus

忘記添加了,nginx,與 Gitlab 捆綁在一起是禁用的。我使用另一個 nginx,從儲存庫安裝。

還嘗試重新啟動普羅米修斯 - 沒有運氣。

~$ sudo gitlab-ctl restart prometheus
ok: run: prometheus: (pid 32380) 0s

~$ curl -I http://localhost:9090
curl: (7) Failed to connect to localhost port 9090: Connection refused

更新。

但是現在prometheus日誌不是空的!不知何故,它的組被刪除了。

重啟後prometheus日誌不為空!不知何故,組gitlab-prometheus被刪除了。恢復組後,一切正常。

引用自:https://serverfault.com/questions/951836