文章目录
官网:https://prometheus.io/
下载地址:https://prometheus.io/download/
下载如下四个组件
Prometheus Server
Pushgateway
Alertmanager(选择性安装)
Node Exporter(选择性安装)
安装 Prometheus Server
Prometheus 基于 Golang 编写,编译后的软件包,不依赖于任何的第三方依赖。只需要下载对应平台的二进制包,解压并且添加基本的配置即可正常启动Prometheus Server。
上传安装包
上传 prometheus-2.29.1.linux-amd64.tar.gz 到虚拟机的/opt/software 目录
解压安装包
➢ 解压到/opt/module 目录下
[root@hadoop102 software]$ tar -zxvf prometheus-2.29.1.linux-amd64.tar.gz -C /opt/module
➢ 修改目录名
[root@hadoop102 ~] cd /opt/module
[root@hadoop102 module] mv prometheus-2.29.1.linux-amd64 prometheus-2.29.1
修改配置文件 prometheus.yml
[root@hadoop102 prometheus-2.29.1]$ vim prometheus.yml
在 scrape_configs 配置项下添加配置:
一定要注意格式
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['hadoop102:9090']
# 添加 PushGateway 监控配置
- job_name: 'pushgateway'
static_configs:
- targets: [

最低0.47元/天 解锁文章
4万+





