1.下载普罗米修斯安装包
2.解压 # tar -zxvf prometheus-2.15.2.linux-amd64.tar.gz
3.重命名:# mv prometheus-2.15.2.linux-amd64 prometheus215
4.配置文件:# vi/usr/local/prometheus215/prometheus.yml(千万注意格式不能乱)
这个是它的配置文件,可以修改端口等信息,默认端口为 9090,后面添加下面两个端口。
static_configs:
- targets: ['localhost:9090']
- job_name: 'linux'
static_configs:
- targets: ['localhost:9100']
- job_name: 'mysql'
static_configs:
- targets: ['localhost:9104']
5.设置文件权限:# chmod777prometheus.yml
6.从配置文件启动 cd 切到目录# cd /usr/local/prometheus215/
# ./prometheus --config.file=p