mogno_exporter使用一个agent监控整个mongo集群

背景:由于官方mogno_exporter更新至最新版本后–help并没用显示支持ip1:port1,ip2:port2这种形式,直接参参数启动的时候会有报错(直连无法操作多个ip)
level=error msg=“Cannot connect to MongoDB: invalid MongoDB options: a direct connection cannot be made if multiple hosts are specified”

百度了很久,找到的示例都是单节点的,或者是老版本基于二进制启动(楼主尝试之后,老版本二进制启动也无法直接使用多ip)

经过对–help中参数摸索,可以使用–no-mongodb.direct-connect解决

由于我使用的是docker-compose启动yaml,示例入下:
#mongo-exporter
  mogno-exporter:
    image: percona/mongodb_exporter:0.35.0
    environment:
      
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
blackbox_exporter 是一个 Prometheus 监控工具,专门用于对黑盒系统进行监控。以下是一个使用 blackbox_exporter 监控 HTTP 服务的示例: 1. 安装 blackbox_exporter: ``` $ wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.18.0/blackbox_exporter-0.18.0.linux-amd64.tar.gz $ tar xvfz blackbox_exporter-0.18.0.linux-amd64.tar.gz $ cd blackbox_exporter-0.18.0.linux-amd64 $ sudo mv blackbox_exporter /usr/local/bin/ ``` 2. 配置 blackbox_exporter: 创建一个配置文件,例如 `blackbox.yml`: ``` modules: http_2xx: prober: http timeout: 5s http: valid_http_versions: ["HTTP/1.1", "HTTP/2"] method: GET no_follow_redirects: false fail_if_ssl: false scrape_configs: - job_name: http metrics_path: /probe params: module: [http_2xx] static_configs: - targets: - http://www.example.com - https://www.example.com relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: localhost:9115 ``` 3. 启动 blackbox_exporter: ``` $ blackbox_exporter --config.file=blackbox.yml ``` 4. 配置 Prometheus: 在 Prometheus 的配置文件中添加如下内容: ``` scrape_configs: - job_name: blackbox metrics_path: /probe params: module: [http_2xx] static_configs: - targets: - http://localhost:9115 relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_module] target_label: __metrics_path__ replacement: /probe ``` 这样,Prometheus 就可以定期从 blackbox_exporter 获取监控

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值