部署mongodb_exporter

部署mongodb_exporter

   小樱     2022年6月27日 20:24     1407    

1、下载

在github上下载有关mongodb_exporter的程序。

https://github.com/percona/mongodb_exporter/releases/tag/v0.32.0


2、配置启动服务

[Unit]
Description=MongoDB Exporter
User=root
[Service]
Type=simple
Restart=always
ExecStart=mongodb_exporter  --mongodb.uri=mongodb://账号:密码@localhost:27017 --web.listen-address=:9218

[Install]
WantedBy=multi-user.target


3、启动

systemctl start mongodb_exporter

systemctl enable mongodb_exporter


4、配置prometheus

配置prometheus

- job_name: "mongodb_monitor"
  static_configs:
  - targets: ["192.168.1.1:9218"]

重启prometheus,或者掉接口重载prometheus配置。


5、一些监控参数

mongodb_ss_uptime

mongodb启动的时间,时间数是秒。

这个去验证的话,可以直接在mongodb中查看服务器的运行状态

db.serverStatus()

其中会有uptime参数


mongodb_ss_connections

mongodb的连接数

其中包含current、availabel、totalCreated

当前链接、累计有效链接、累计创建链接。


文章评论

0

其他文章