Docker安装promethues
来自Linux78|wiki
docker pull prom/node-exporter docker pull prom/prometheus docker pull grafana/grafana
启动prometheus
新建目录prometheus,编辑配置文件prometheus.yml
mkdir /opt/prometheus
cd /opt/prometheus/
vim prometheus.yml
global:
scrape_interval: 60s
evaluation_interval: 60s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
labels:
instance: prometheus
- job_name: linux
static_configs:
- targets: ['192.168.0.132:9100']
labels:
instance: localhost
注意:修改IP地址,这里的192.168.0.132就是本机地址
启动prometheus
docker run -d \ -p 9090:9090 \ -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \ prom/prometheus
访问url:
http://192.168.91.132:9090/graph
启动node-exporter
docker run -d -p 9100:9100 \ -v "/proc:/host/proc:ro" \ -v "/sys:/host/sys:ro" \ -v "/:/rootfs:ro" \ --net="host" \ prom/node-exporter
访问url:
返回: Prometheus