简单介绍
rocketmq_exporter是prometheus提供的用于监控rocketmq运行状态的exporter
环境
| 系统 |
版本 |
| CentOS |
7.6.1810 (Core) |
| CPU/内存 |
4核、8G |
clone已有软件包,自行mvn
[root@ecs rocketmq-exporter]# pwd /opt/rocketmq-exporter
vim pom.xml

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.2.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>org.apache</groupId> <artifactId>rocketmq-exporter</artifactId> <version>0.0.2-SNAPSHOT</version> <name>rocketmq-exporter</name> <description>Apache RocketMQ Prometheus Exporter</description> <properties> <rocketmq.version>4.9.4</rocketmq.version> <docker.image.prefix>docker.io</docker.image.prefix> </properties> <dependencies> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>19.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-tools</artifactId> <version>${rocketmq.version}</version> </dependency> <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-store</artifactId> <version>${rocketmq.version}</version> </dependency> <dependency> <groupId>org.jooq</groupId> <artifactId>joor</artifactId> <version>0.9.6</version> </dependency> <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient</artifactId> <version>0.6.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.7</version> <executions> <execution> <goals> <goal>prepare-agent</goal> </goals> </execution> <execution> <id>report</id> <phase>test</phase> <goals> <goal>report</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <executable>true</executable> </configuration> </plugin> <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.17</version> <executions> <execution> <id>verify</id> <phase>verify</phase> <configuration> <configLocation>style/rmq_checkstyle.xml</configLocation> <encoding>UTF-8</encoding> <consoleOutput>true</consoleOutput> <failsOnError>true</failsOnError> <includeTestSourceDirectory>false</includeTestSourceDirectory> </configuration> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> --> <!-- Use dockerfile-maven instead, https://github.com/spotify/dockerfile-maven --> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.4.11</version> <dependencies> <dependency> <groupId>javax.activation</groupId> <artifactId>javax.activation-api</artifactId> <version>1.2.0</version> <scope>compile</scope> </dependency> </dependencies> <configuration> <imageName>${docker.image.prefix}/${project.artifactId}</imageName> <dockerDirectory>src/main/docker</dockerDirectory> <resources> <resource> <targetPath>/</targetPath> <directory>${project.build.directory}</directory> <include>${project.build.finalName}.jpackagingar</include> </resource> </resources> </configuration> </plugin> <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> <version>0.12</version> <configuration> <excludes> <exclude>.travis.yml</exclude> <exclude>.asf.yaml</exclude> <exclude>CONTRIBUTING.md</exclude> <exclude>.github/*</exclude> <exclude>.github/*/*</exclude> <exclude>pom.xml</exclude> <exclude>style/**</exclude> <exclude>README.md</exclude> <exclude>BUILDING</exclude> <exclude>LICENSE</exclude> <exclude>NOTICE</exclude> <exclude>example.rules</exclude> <exclude>rocketmq_exporter_quickstart.md</exclude> <exclude>rocketmq_exporter_overview.json</exclude> <exclude>src/main/resources/application.yml</exclude> </excludes> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.7</version> <configuration> <formats> <format>html</format> <format>xml</format> </formats> <check/> </configuration> </plugin> </plugins> </build> </project>
编辑配置添加namesrvAddr(若roketmq为k8s 部署直接填写k8s地址即可,集群用;隔开)
vim src/main/resources/application.yml
开始编译(后面跟着打docker镜像,若失败可直接进入 target/docker目录手动build docker)
mvn package -Dmaven.test.skip=true docker:build
手动build
docker build -t docker.io/rocketmq-exporter:dev .
手动build时,将编译好的jar包cp到Dockerfile所在目录
cp ../rocketmq-exporter-0.0.2-SNAPSHOT.jar ./
编译
docker build -t docker.io/rocketmq-exporter:dev .
docker push docker.io/rocketmq-exporter:dev
自定义docker 仓库
docker build -t xxxxxxx/rocketmq-exporter:dev .
docker push xxxxxxxx/rocketmq-exporter:dev
使用打出的镜像部署 rocketmq-exporter 到k8s 即可
Prometheus配置
- job_name: rocketmq-exporter-cfhy
static_configs:
- targets: ["rocketmq-exporter.monitoring.svc.cluster.local:5557"] #端口可以在application.yml中自己定义
labels:
instance: rocketmq-exporter-cfhy.rocketmq
grafana导入模板 14612
总结
以上部署rocketmq_exporter监控rocketmq的方法,有问题联系博主,后续也有其他插件,欢迎交流
- rocketMQ安装部署详细解析
近来研究了Apache开源项目rocketMQ(原为阿里项目),并在两台linux服务器上完成了部署,现在整理下,供大家参考学习. 一.简介rocketMQRocektMQ是阿里巴巴在2012年开源的 ...
- rocketmq单点部署
下载地址:https://github.com/alibaba/RocketMQ 转载请注明来源:http://blog.csdn.net/loongshawn/article/details/510 ...
- windows下RocketMQ安装部署
一.预备环境 1.系统 Windows 2. 环境 JDK1.8.Maven.Git 二. RocketMQ部署 1.下载 1.1地址:http://rocketmq.apache.org/relea ...
- RocketMQ的部署方式及持久化方式
RocketMQ 的 Broker 有三种集群部署方式: 1. 单台 Master 部署: 2. 多台 Master部署: 3. 多 Master 多 Slave 部署:采用第 3 种部署方式时, M ...
- rocketmq安装部署过程(4.0.0版本)
准备工作 3个虚拟机节点的构成如下 : 安装步骤 操作过程 1.安装包已经上传至其中1个节点. 2.解压缩安装包 命令:unzip rocketmq-all-4.0.0-incubating-bin- ...
- RocketMQ安装部署
一.简介RocketMQ RocektMQ是阿里巴巴在2012年开源的一个纯java.分布式.队列模型的第三代消息中间件,不仅在传统高频交易链路有着低延迟的出色表现,在实时计算等大数据领域也有着不错的 ...
- linux环境上 rocketmq 安装部署
Rocketmq-简单部署 一.准备环境 1.系统:Centos7.3(无硬性要求) 2. jdk:1.8 3.maven:3.5(无硬性要求) 4.git 5.rocketmq 4.2 二.环境 ...
- RocketMQ安装部署及整合Springboot
消息中间件的功能: 通过学习ActiveMq,kafka,rabbitMq这些消息中间件,我们大致能为消息中间件的功能做一下以下定义:可以先从基本的需求开始思考 最基本的是要能支持消息的发送和接收,需 ...
- RocketMQ 单机部署(单master模式)
一.为了快速了解rockmq,先搭建一个简单的单机版的rocketmq,前期准备:1.CentOS 7.6 64位(阿里云)(4G内存) 2.jdk1.8 3.maven 3.5.4 4.直接从官网上 ...
- RocketMQ生产部署架构如何设计
前言 看了我们之前的文章,相信小伙伴们对RocketMQ已经有了一个初步的了解,那么今天我们就来聊一聊具体如何来设计一套高可用的生产部署架构. 在聊如何设计这套架构的同时,我们再补充一些之前没提到的知 ...
随机推荐
- 实操记录之-----Ant Design of Vue 增强版动态合并单元格,自动根据数据进行合并,可自定义横纵向合并
前几天搞了个简易版的动态合并单元格 但是需求有变化,就只能稍微改改了~~ 欢迎路过的各位大佬指出我代码的问题~~~~ 另: 代码执行效率不是很高,如果需要大量渲染更多数据建议可以直接使用原生 < ...
- 如何解决github下载很慢的问题?(已经解决)
目的是为了解决GitHub致命的下载速度慢的问题 方法 通过码云来导入github,通过码云下载 1.在github上面找到自己想要的项目 这一步略过 2.复制github项目上面的网页链接 3.打开 ...
- Google Cloud Spanner 究竟是什么?
谷歌于2017年推出的Google Cloud Spanner,原是谷歌内部使用的一个数据服务,后来又成为了谷歌云平台上搭建的数据库服务. Google Cloud Spanner 是一种数据库,它结 ...
- mov eax,dword ptr[0x00aff834] 和 lea eax,[0x00aff834]区别
mov eax,dword ptr[0x00aff834] 和 lea eax,[0x00aff834]区别 mov eax,[内存]是将内存的值赋值给eax,而lea是直接将地址值赋值给eax 因此 ...
- Grafana 系列文章(六):Grafana Explore 中的日志
️URL: https://grafana.com/docs/grafana/latest/explore/logs-integration/#labels-and-detected-fields D ...
- RabbitMQ消息队列入门及解决常见问题
RabbitMQ消息队列 同步通讯和异步通讯 微服务间通讯有同步和异步两种方式: 同步通讯:就像打电话,需要实时响应. 异步通讯:就像发邮件,不需要马上回复. 两种方式各有优劣,打电话可以立即得到响应 ...
- springboot自定义验证-传值范围
package com.xf.common; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static ...
- ChatGPT:让程序开发更轻松
作者:京东科技 赵龙波 "贾维斯,你在吗?" "随时待命,先生." 类似<钢铁侠>里的人工智能助理贾维斯,ChatGPT或许是你的随时待命的助手.C ...
- 力扣---2319. 判断矩阵是否是一个 X 矩阵
如果一个正方形矩阵满足下述 全部 条件,则称之为一个 X 矩阵 : 矩阵对角线上的所有元素都 不是 0 矩阵中所有其他元素都是 0给你一个大小为 n x n 的二维整数数组 grid ,表 ...
- P6_认识小程序页面
JSON 配置文件 新建小程序页面 只需要在 app.json -> pages 中新增页面的存放路径,小程序开发者工具即可帮我们自动创建对应的页面文件 修改项目首页 只需要调整 app.jso ...