Đào tạo doanh nghiệpQuản trị VPS & Linux Nâng cao: Tối ưu Hiệu năng, Giám sát Grafana, Bảo mật Chủ động & Phục hồi Thảm họa
2/8

Giáo trình tự học miễn phí · Dịch vụ hỗ trợ theo nhu cầu.

Bài 0240phút ước tínhNâng cao · Chuyên sâu

2. Dựng Cụm Giám Sát Realtime: Prometheus, Node Exporter & Dashboard Grafana Chuyên Nghiệp

Biến VPS thành trung tâm giám sát trực quan: Thu thập dữ liệu CPU, RAM, Disk I/O, Network traffic với Node Exporter và trực quan hóa trên Grafana.

📊 Kiến Trúc Cụm Giám Sát 3 Tầng

  • Node Exporter: Thu thập chỉ số phần cứng (Metrics) từ Linux OS trên cổng 9100.
  • Prometheus: Cơ sở dữ liệu Time-series định kỳ cào (Scrape) dữ liệu từ Node Exporter trên cổng 9090.
  • Grafana: Nền tảng hiển thị biểu đồ và bảng điều khiển (Dashboard) trực quan trên cổng 3000.
example.py
# docker-compose-monitoring.yml
version: '3.8'

services:
  node-exporter:
    image: prom/node-exporter:latest
    container_name: monitoring_node_exporter
    restart: unless-stopped
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
    command:
      - '--path.procfs=/host/proc'
      - '--path.sysfs=/host/sys'
      - '--path.rootfs=/rootfs'
    ports:
      - "9100:9100"

  prometheus:
    image: prom/prometheus:latest
    container_name: monitoring_prometheus
    restart: unless-stopped
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
      - prometheus_data:/prometheus
    ports:
      - "9090:9090"

  grafana:
    image: grafana/grafana:latest
    container_name: monitoring_grafana
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - grafana_data:/var/lib/grafana

volumes:
  prometheus_data:
  grafana_data:
Thực hành

Thực hành và tự đánh giá

Import mẫu Dashboard 1860 (Node Exporter Full) vào Grafana và quan sát biểu đồ nhiệt độ CPU, mức đọc/ghi ổ đĩa.

🏢 BẠN MUỐN TRIỂN KHAI CHO CẢ PHÒNG BAN / DOANH NGHIỆP?
Đề Xuất Công Ty Tài Trợ & Đào Tạo In-House Trọn Gói

AI Tinh Gọn hỗ trợ khảo sát hiện trạng, kèm 1-1 on-premise bảo mật dữ liệu, setup hạ tầng riêng và xuất hóa đơn VAT hợp pháp cho doanh nghiệp.

⚖️ Bản quyền sở hữu trí tuệ: © 2026 AI Tinh Gọn (aitinhgon.vn) · Giấy phép Creative Commons CC BY-NC-ND 4.0. Cho phép tự học cá nhân, nghiêm cấm thương mại hóa hoặc bán lại. Giáo trình mở →

Tiến độ tự học lưu trên trình duyệt này. Chỉ đánh dấu khi đã kiểm tra sản phẩm thực hành.