1、建立prometheus【prometheus.yml】配置
global: scrape_interval: 15s evaluation_interval: 15s scrape_configs: - job_name: 'prometheus' static_configs: - targets: ['192.168.2.216:9090']
2、建立【docker-compose.yml】
version: '3' services: prometheus: image: prom/prometheus container_name: prometheus ports: - "9090:9090" volumes: - ./config/prometheus.yml:/etc/prometheus/prometheus.yml - ./data:/prometheus
3、啟動prometheus
docker-compose up -d
4、訪問服務
http://192.168.2.216:9090/graph
5、需要檢測的伺服器部署檢測端