Prometheus 的安装

官网: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: [
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值