一键部署 Prometheus

专业级的监控系统,定时去检查你的服务器、网站、数据库是否正常运行,把各项指标存起来,配合 Grafana 画出漂亮的趋势图,是运维人员的标配

前置准备

1
一台 Linux 服务器
服务器最低配置:1024MB 内存 + 20GB 硬盘,推荐阿里云/腾讯云轻量应用服务器(月费约 ¥50-100)
2
安装部署 Agent
在服务器终端执行一行命令即可安装:
curl -fsSL https://awesome-toolkit.pages.dev/agent/install-agent.sh | bash
!
特别注意事项
  • 已内置 Node Exporter 采集系统指标(CPU、内存、磁盘、网络)
  • 建议配合 Grafana 使用,可一键导入 1860 号仪表盘模板获得精美大屏
  • 默认保留 30 天数据,可在 compose 文件中修改 retention.time

一键部署到你的服务器

在网页上填写服务器 IP 和 Agent Token,自动完成:检测系统 → 拉取镜像 → 启动服务

开始部署向导
💻 或者手动使用 Agent 命令行(高级用户)

🤖 通过 Agent 部署

先安装 Agent,然后通过它一键部署。Agent 会帮你管理所有部署的工具。

步骤 1:安装 Agent

curl -fsSL https://awesome-toolkit.pages.dev/agent/install-agent.sh | bash

步骤 2:部署工具

curl -fsSL https://awesome-toolkit.pages.dev/deploy/install.sh | bash -s -- prometheus

Agent 会自动完成:检测 Docker → 拉取镜像 → 启动服务,整个过程 3-5 分钟

🎯 部署完成后

🔗
访问地址
http://你的服务器IP:9090
💡
下一步

浏览器访问查看监控指标,默认已监控本机。要监控其他服务器,编辑 prometheus.yml 添加目标地址后重启容器。

💻 服务器配置要求

1GB
内存
20GB
硬盘
1
端口
3-5分钟
部署耗时

📋 常用管理命令

部署完成后,SSH 进入 ~/awesome-tools/prometheus 目录,然后运行:

docker compose ps查看运行状态
docker compose logs -f查看实时日志
docker compose restart重启服务
docker compose pull && docker compose up -d更新到最新版本
docker compose down停止服务