promerheus+grafana+node_exporter 配置

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

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
    原文作者:shaonbean
    原文地址: https://segmentfault.com/a/1190000020234397
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞