Docker run Prometheus and Grafana
(Jin Qing's column 2018.4)
The running example of Prometheus's official website is direct execution.
You can use Docker to run Prometheus and Grafana using the https://www.katacoda.com/tutorial.
To search the Grafana tutorial, run the following steps: Write Prometheus.yml
Global:
scrape_interval: 15s
evaluation_interval:15s
scrape_configs:
-job_name: ' Prometheus '
static_configs:
-Targets: [' localhost:9090 ', ' localhost:9100 ']
Labels:
group: ' Prometheus
LocalHost doesn't seem to work, replace 127.0.0.1 run Prometheus
Docker run-d--net=host \
-v/root/prometheus.yml:/etc/prometheus/prometheus.yml \
--name prometheus-server \
Prom/prometheus
Run Node Exporter
Docker run-d-P 9100:9100 \
v "/proc:/host/proc" \
V "/sys:/host/sys" \
V "/:/rootfs" \
--net= "host" \
--name=prometheus \
quay.io/prometheus/node-exporter:v0.13.0 \
-collector.procfs/host/proc \
- Collector.sysfs/host/sys \
-collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc) ($|/)"
Run Grafana
Docker run-d--name=grafana-p 3000:3000 Grafana/grafana
Default User: Admin/admin Add data source and import Dashboard
ADD Data Sources->
Name:prometheus
Type:prometheus
url:http://1.2.3.4:9090
Access:proxy
Save & Test ...
Create Import->
Grafana.com dashboard:22