Thank you for reading this post, don't forget to subscribe!
После обновления Prometheus наотрез отказывался запускаться:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
systemctl status prometheus.service ● prometheus.service - LSB: Prometheus monitoring system and time series database Loaded: loaded (/usr/lib/systemd/system/prometheus.service; enabled) Active: failed (Result: start-limit) since Mon 2016-10-24 11:47:54 EEST; 16s ago Process: 17107 ExecStop=/etc/init.d/prometheus stop (code=exited, status=0/SUCCESS) Process: 17086 ExecStart=/etc/init.d/prometheus start (code=exited, status=0/SUCCESS) Main PID: 17093 (code=exited, status=1/FAILURE) Oct 24 11:47:54 stat.ua systemd[1]: Unit prometheus.service entered failed state. Oct 24 11:47:54 stat.ua systemd[1]: prometheus.service holdoff time over, scheduling restart. Oct 24 11:47:54 stat.ua systemd[1]: Stopping LSB: Prometheus monitoring system and time series database… Oct 24 11:47:54 stat.ua systemd[1]: Starting LSB: Prometheus monitoring system and time series database… Oct 24 11:47:54 stat.ua systemd[1]: prometheus.service start request repeated too quickly, refusing to start. Oct 24 11:47:54 stat.ua systemd[1]: Failed to start LSB: Prometheus monitoring system and time series database. Oct 24 11:47:54 stat.ua systemd[1]: Unit prometheus.service entered failed state. Oct 24 11:48:01 stat.ua systemd[1]: Starting LSB: Prometheus monitoring system and time series database… Oct 24 11:48:01 stat.ua systemd[1]: prometheus.service start request repeated too quickly, refusing to start. Oct 24 11:48:01 stat.ua systemd[1]: Failed to start LSB: Prometheus monitoring system and time series database. |
В ходе расследования пытаемся запустить Prometheus руками:
1 2 |
prometheus -config.file /etc/prometheus/prometheus.yml |
и видим следующее сообщение:
1 2 3 4 5 |
INFO[0000] Starting prometheus (version=1.3.0-beta.0, branch=HEAD, revision=f002fe186abd04ecd9<span class="hljs-built_in">cd</span>8961c24bc039f134ea13) <span class="hljs-built_in">source</span>=main.go:75 INFO[0000] Build context (go=go1.6.2, user=root@maya, date=20161024-05:32:39) <span class="hljs-built_in">source</span>=main.go:76 INFO[0000] Loading configuration file /etc/prometheus/prometheus.yml <span class="hljs-built_in">source</span>=main.go:247 ERRO[0000] Error loading config: couldn<span class="hljs-string">'</span><span class="hljs-string">t load configuration </span><span class="hljs-string">(</span><span class="hljs-string">-config.file</span><span class="hljs-string">=</span><span class="hljs-string">/etc/prometheus/prometheus.yml</span><span class="hljs-string">)</span><span class="hljs-string">: unknown fields in scrape_config: target_groups source</span><span class="hljs-string">=</span><span class="hljs-string">main.go:149 </span> |
Первая же ссылка в выдаче Google приводит нас сюда, где четко и ясно написано, что еще с середины июня в конфигурационном файле Prometheus параметр target_groups
был заменен на static_configs
!
Редактируем файл /etc/prometheus/prometheus.yml
, заменяя все вхождения target_groups
на static_configs
, сохраняем его и пробуем запустить Prometheus еще раз:
1 2 |
systemctl start prometheus.service |
Убеждаемся, что теперь все запустилось:
1 2 3 4 5 6 7 8 9 10 11 12 |
systemctl status prometheus.service ● prometheus.service - LSB: Prometheus monitoring system and time series database Loaded: loaded (/usr/lib/systemd/system/prometheus.service; enabled) Active: active (running) since Mon 2016-10-24 11:56:10 EEST; 20min ago Process: 17107 ExecStop=/etc/init.d/prometheus stop (code=exited, status=0/SUCCESS) Process: 27594 ExecStart=/etc/init.d/prometheus start (code=exited, status=0/SUCCESS) Main PID: 27600 (prometheus) CGroup: /system.slice/prometheus.service └─27600 /usr/sbin/prometheus -config.file /etc/prometheus/prometheus.yml -storage.local.path /var/lib/prometheus/data -storage.local.retention=8784h -storage.loca... Oct 24 11:56:10 stat.ua systemd[1]: Started LSB: Prometheus monitoring system and time series database. |
Вывод: не забывайте читать release notes