docker start prometheus
pull prometheus images
- docker pull prom/prometheus
- docker pull prom/node-exporter
- docker pull grafana/grafana
start prometheus & grafana & 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
# 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'
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
# 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