Failed to start Prometheus.service

In yml file u kept the static config with alias right?

image

Block (ports in for Relay 1 9100 / 12798)
Relay 2 (ports in for Relay 1 9100 / 12798)

Relay 1 (ports 3000, 9090) (9100 localhost / 12798 localhost)

image

Top one shows Relay 1 and also bottom one is Relay 1 IP as well.

I see, that’s why if u are looking in my configuration which I sent to u , u will see that I use instance names for node exporter and also for prometheus

send your config again if you can.

on server node edit your prometheus yaml file
here’s mine:

# Here it's Prometheus itself.
scrape_configs:
  - job_name: 'BP_cnode'
    static_configs:
    - targets: ['PRODUCER_IP:12798']
      labels:
        instance: "Producer"
  - job_name: 'BP_node_exporter'
    static_configs:
    - targets: ['PRODUCER_IP:9091']
      labels:
        instance: "Producer"
  - job_name: 'Relay1_cnode'
    static_configs:
    - targets: ['RELAY_1_NODE_EXPORTER_IP:12798']
      labels:
        instance: "Relay1"
  - job_name: 'Relay1_node_exporter'
    static_configs:
    - targets: ['RELAY_1_NODE_EXPORTER_IP:9091']
      labels:
        instance: "Relay1"
  - job_name: 'Relay2_cnode'
    static_configs:
    - targets: ['127.0.0.1:12798']
      labels:
        instance: "Relay2"
  - job_name: 'Relay2_nexporter'
    static_configs:
    - targets: ['127.0.0.1:9091']
      labels:
        instance: "Relay2"

Relay 2 is the server for grafana in my case

  1. on Relay 2 I have opened:

9090/tcp ALLOW 127.0.0.1
12978/tcp ALLOW 127.0.0.1
9091/tcp ALLOW 127.0.0.1

  1. on my other nodes I opened in FW to accept connections from my server to ports 12798 and 9091 (from grafana node server)

you can try and after, restart the services

sudo systemctl restart grafana
sudo systemctl status grafana

sudo systemctl restart prometheus
sudo systemctl status prometheus

and you will use {{instance}} in grafana in order to see your node’s names in grafana…
you cand edit instance string whit the name you will want to see in grafana

changed everything to {{instance}}

image

prometheus service is working… actually its not working anymore.

Try to edit the instances lines to be all the same… I know it has a strange behavior:( everything should be perfect

image

Also I notice that the instances doesn’t have the “ anymore … has ‘

okay its wokring prometheus . service

actually not working again.

Ok… how is grafana now?

Ok; use “ for instances name instead of ‘

I changed the instances name, prometheus. service isnt working again.

and my screenshot is acting up.

scrape_configs:

The job name is added as a label job=<job_name> to any timeseries scraped from this config.

  • job_name: ‘BP_cnode’
    static_configs:
    • targets: [‘x.x.x.x:12798’]
      labels:
      instance: ‘Producer’
  • job_name: ‘BP_node_exporter’
    static_configs:
    • targets: [‘x.x.x.x:9100’]
      labels:
      instance: ‘Producer’
  • job_name: ‘Relay1_cnode’
    static_configs:
    • targets: [‘127.0.0.1:12798’]
      labels:
      instance: ‘Relay1’
  • job_name: ‘Relay1_node_exporter’
    static_configs:
    • targets: [‘127.0.0.1:9100’]
      labels:
      instance: ‘Relay1’
  • job_name: ‘Relay2_cnode’
    static_configs:
    • targets: [‘x.x.x.x:12798’]
      labels:
      instance: ‘Relay2’
  • job_name: ‘Relay2_node_exporter’
    static_configs:
    • targets: [‘x.x.x.x:9100’]
      labels:
      instance: ‘Relay2’

Need to be


labels:
      instance: “Relay2”

!!! use


“” for intances instead ‘’

https://youtu.be/lcIWj1Xm3UM - min 42

it worked for 1 second:

image

Press 3 spaces before instance line (move 3 spaces to the right)

U don’t need to use TAB for moving the line ; only spaces … it’s weird but …

This fixed it

image

1 Like