Prometheus Manager Web 的安装步骤如下:
- 安装 Node.js
首先需要在服务器上安装 Node.js。可以使用以下命令来检查是否已经安装了 Node.js:
node -v
如果已经安装了,则会显示 Node.js 的版本号。否则,需要按照官方文档的指导进行安装。
- 下载和解压缩 Prometheus Manager Web
可以从 GitHub 上下载 Prometheus Manager Web 的代码,并解压缩到一个合适的目录中。
wget https://github.com/cloudflare/prometheus-manager-web/releases/download/v0.5.0/prometheus-manager-web-v0.5.0.tar.gz
tar zxvf prometheus-manager-web-v0.5.0.tar.gz
- 配置 Prometheus Manager Web
进入 Prometheus Manager Web 的目录,编辑配置文件 config.json
,将其中的 prometheusUrl
修改为你自己的 Prometheus 服务器地址。
cd prometheus-manager-web-v0.5.0
vi config.json
{
"prometheusUrl": "http://localhost:9090",
"port": 8081,
"host": "localhost"
}
- 启动 Prometheus Manager Web
执行以下命令启动 Prometheus Manager Web:
npm install # 可选,用于更新依赖库
npm start
此时会启动一个 HTTP 服务器,默认监听端口为 8081
。你可以通过浏览器访问该端口来打开 Prometheus Manager Web 的页面。
注意:如果你使用防火墙或者其他网络设备,需要允许客户端访问 Prometheus Manager Web 的监听端口。