promerheus+grafana+node_exporter 구성

1806 단어 dockerprometheus
docker start prometheus
pull prometheus images
  • docker pull prom/prometheus
  • docker pull prom/node-exporter
  • docker pull grafana/grafana

  • start prometheus & grafana & node_exporter
  • start node_exporter
  • docker run -d --name=node-exporter -p 9100:9100 -v "/proc:/host/proc:ro" -v "/sys:/host/sys:ro" -v "/:/rootfs:ro" --net="host" prom/node-exporter
  • config prometheus
  • # mkdir /etc/prometheus ,add prometheus.yml
    # vim prometheus.yml
    global:
      scrape_interval:     15s
      evaluation_interval: 15s
    
    scrape_configs:
      - job_name: 'prometheus'
    
        static_configs:
          - targets: ['127.0.0.1:9090', '127.0.0.1:9100']
            labels:
              group: 'prometheus'
  • start prometheus
  • docker run -d --name=prometheus -p 9090:9090 -v /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml  prom/prometheus
  • reference: https://www.fosslinux.com/103...

  • start influxdb
    docker volume create vol-influxdb
    docker run -d --name=influxdb -p 8083:8083 -p 8086:8086 -v vol-influxdb:/var/lib/influxdb influxdb
  • config influxdb
  • # docker exec -it 4362fc6a166a /bin/bash        
    root@4362fc6a166a:/# influx
    Connected to http://localhost:8086 version 1.7.7
    InfluxDB shell version: 1.7.7
    > create database telegraf
    > use telegraf
    Using database telegraf
    > create user telegraf with password 'telegraf'
    > show databases
    name: databases
    name
    ----
    _internal
    telegraf
    > show users
    user     admin
    ----     -----
    telegraf false
    > quit
    root@4362fc6a166a:/# 

    install telegraf
  • start telegraf
  • 좋은 웹페이지 즐겨찾기