prometheus监控系统-安装
install
获取镜像
docker pull prom/node-exporter
docker pull prom/prometheus
启动prometheus
创建yaml
mkdir -p /etc/prometheus/
mkdir -p /prometheus
vim /etc/prometheus/prometheus.yml
global:
scrape_interval: 60s
evaluation_interval: 60s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['192.168.2.219:9090']
labels:
instance: prometheus
- job_name: linux
static_configs:
- targets: ['192.168.2.144:9100']
labels:
instance: db
- job_name: mysql
static_configs:
- targets: ['192.168.2.144:9104']
labels:
instance: db
启动:
docker run -d \
-p 9090:9090 \
-v /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
访问 http://192.168.2.219: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