docker-compose部署prometheus+grafana進行伺服器監控

扰扰發表於2024-03-14

1、建立prometheus【prometheus.yml】配置

docker-compose部署prometheus+grafana進行伺服器監控
global: 
  scrape_interval:     15s 
  evaluation_interval: 15s 
 
scrape_configs: 
  - job_name: 'prometheus' 
    static_configs: 
      - targets: ['192.168.2.216:9090'] 
View Code

2、建立【docker-compose.yml】

docker-compose部署prometheus+grafana進行伺服器監控
version: '3' 
 
services: 
  prometheus: 
    image: prom/prometheus 
    container_name: prometheus 
    ports: 
      - "9090:9090" 
    volumes: 
      - ./config/prometheus.yml:/etc/prometheus/prometheus.yml 
      - ./data:/prometheus
View Code

3、啟動prometheus

docker-compose up -d 

4、訪問服務

http://192.168.2.216:9090/graph

5、需要檢測的伺服器部署檢測端

相關文章