系统要求

  • Linux(推荐 Ubuntu_20_04 或 CentOS_8)
  • macOS(需 Homebrew)
  • Windows(需安装 WSL2)

安装步骤

  1. 下载 Prometheus

    • 官方网站:Prometheus 下载页面
    • Linux: wget https://github.com/prometheus/prometheus/releases/download/v2.34.0/prometheus-2.34.0.linux-amd64.tar.gz
    • macOS: brew install prometheus
    • Windows: 下载 .msi 安装包并运行
  2. 解压与配置

    • Linux: tar -xzf prometheus-*.tar.gz
    • macOS: 自动解压并配置环境变量
    • Windows: 双击安装向导,选择安装路径
  3. 启动服务

    • Linux: ./prometheus --config.file=prometheus.yml
    • macOS: prometheus --config.file=prometheus.yml
    • Windows: 通过服务管理器启动 Prometheus 服务

常见问题

  • 🚨 安装失败?检查防火墙是否开放 9090 端口
  • 🧰 配置文件语法错误?使用 ./promtool check config prometheus.yml 验证

扩展阅读

Prometheus 配置详解 ⬆️

Prometheus_logo
Linux_installation
Windows_installation