1. 安装Prometheus及简单使用

一、yum 安装 prometheus

1. 官网下载安装包

https://prometheus.io/download/

2. 解压

$ tar xvfz prometheus-2.32.0-beta.0.linux-amd64.tar.gz -C /home

3. 重命名

mv prometheus-2.32.0-beta.0.linux-amd64/ prometheus-2.32.0

4. 维护配置文件

prometheus.yml 是 Prometheus 的配置文件。配置信息详细介绍可查看官方文档:https://prometheus.io/docs/prometheus/latest/configuration/configuration/

prometheus.yml 部分配置信息如下:

# 全局配置
global:
  scrape_interval: 15s # 设置每15s采集数据一次,默认1分钟
  evaluation_interval: 15s # 每15秒计算一次规则,默认1分钟
  # scrape_timeout:15s #  采集数据超时时间,默认10s。
  
# 告警配置
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# 告警规则,Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# 在 scrape_config 中每个监控目标是一个job,但job的类型有很多种。可以是最简单的 static_config,即静态地指定每一个目标。
scrape_configs:
  #  这是 prometheus 本机的一个监控节点
  - job_name: "prometheus"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      # targets 配置要监控的节点,格式:机器名+端口号。配置完成后,prometheus就可以通过配置文件识别监控的节点,持续开始采集数据
      # 可以并列写入多个节点,用逗号隔开
      - targets: ["localhost:9090"]
  - 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值