pulsar监控系统prometheus+grafana(一,安装)

prometheus安装

下载地址https://prometheus.io/
tar -zxvf prometheus-2.0.0.linux-amd64.tar.gz
cd prometheus-2.0.0.linux-amd64.tar.gz
./prometheus

配置项

  1. 全局配置

  2. global:
  3. scrape_interval: 15s # 默认 15秒到目标处抓取数据
  4. 这个标签是在本机上每一条时间序列上都会默认产生的,主要可以用于 联合查询、远程存储、Alertmanger时使用。

  5. external_labels:
  6. monitor: ‘codelab-monitor’
  7. 这里就表示抓取对象的配置

  8. 设置抓取自身数据

  9. scrape_configs:
  10. job name 这个配置是表示在这个配置内的时间序例,每一条都会自动添加上这个{job_name:“prometheus”}的标签。

    • job_name: ‘prometheus’
  11. 重写了全局抓取间隔时间,由15秒重写成5秒。

  12. scrape_interval: 5s
  13. static_configs:
    • targets: [‘localhost:9090’]

简单配置
prometheus.yml
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.

scrape_timeout is set to the global default (10s).

alerting:
alertmanagers:

  • static_configs:
    • targets:

      - alertmanager:9093

rule_files:

- “first_rules.yml”

- “second_rules.yml”

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: [‘localhost:9090’]
      labels:
      instance: prometheus

#监控canal

  • job_name: ‘canal’

    metrics_path defaults to ‘/metrics’

    scheme defaults to ‘http’.

    static_configs:
    • targets: [‘c9:11112’,‘c6:11112’]
      labels:
      instance: canal

#监控doris

  • job_name: ‘PALO_CLUSTER’ # 每一个 Doris 集群,我们称为一个 job。这里可以给 job 取一个名字,作为 Doris 集群在监控系统中的名字。
    #metrics_path: ‘/metrics’ # 这里指定获取监控项的 restful api。配合下面的 targets 中的 host:port,Prometheus 最终会通过 host:port/metrics_path 来采集监控项。
    static_configs: # 这里开始分别配置 FE 和 BE 的目标地址。所有的 FE 和 BE 都分别写入各自的 group 中。
    • targets: [‘c9:8030’,‘c6:8030’,‘c3:8030’]
      labels:
      group: fe # 这里配置了 fe 的 group,该 group 中包含了 3 个 Frontends

    • targets: [‘c9:8040’,‘c6:8040’,‘c3:8040’]
      labels:
      group: be # 这里配置了 be 的 group,该 group 中包含了 3 个 Backends

#监控pulsar

  • job_name: ‘pulsar-project’

    Override the global default and scrape targets from this job every 5 seconds.

    scrape_interval: 5s
    static_configs:
    #监控broker
    • targets: [‘c2:8080’,‘c3:8080’,‘c4:8080’,‘c5:8080’,‘c6:8080’]
      labels:
      group: ‘pulsar-broker-state’
      #监控bookie
    • targets: [‘c2:8000’,‘c3:8000’,‘c4:8000’,‘c5:8000’,‘c6:8000’]
      labels:
      group: ‘pulsar-bookie-state’

启动命令
./prometheus --config.file “/mnt/prometheus-2.7.0.linux-amd64/prometheus.yml” --web.enable-lifecycle --storage.tsdb.retention=10d
默认访问端口
9090
http://c9:9090

grafana安装

安装
wget https://dl.grafana.com/oss/release/grafana-5.4.3.linux-amd64.tar.gz
tar zxfv 安装包
启动
./bin/grafana-server web

默认访问端口 3000
http://c9:3000

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值