简单介绍
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已经有了一个初步的了解,那么今天我们就来聊一聊具体如何来设计一套高可用的生产部署架构. 在聊如何设计这套架构的同时,我们再补充一些之前没提到的知 ...
随机推荐
- 複合語句塊——關於while循環的
看這兩個小段代碼: /*code1.*/ index=0; while(index<10) sam = 10*index+2; printf("sam=%d\n",sam); ...
- 最新版 Proteus 8.15 Professional 图文安装教程 [ 附安装包 ]
前言 Proteus 是世界上唯一将电路仿真软件.PCB设计软件和虚拟模型仿真软件三合一的设计平台. Proteus 8.15 现已发布,本篇将带领大家安装此版本. 介绍 Proteus Proteu ...
- 字符串拼接输出-Predicate接口
字符串拼接输出 下面的字符串数组当中存有多条信息,请按照格式""\姓名∶XX.性别:xx."的格式将信息打印出来.要求将打印姓名的动作作为第一个Consumer 接口的L ...
- java入门与进阶P-4.7
最大公约数 首先做这个题需要先复习几组概念: 如果数a能被数b整除,a就叫做b的倍数,b就叫做a的约数.几个整数中公有的约数,叫做这几个数的公约数:其中最大的一个,叫做这几个数的最大公约数.举例: 1 ...
- 亲测有效 Hyper V3.4.0 终端美化工具 支持win/mac
亲测有效 Hyper V3.4.0 终端美化工具 支持win/mac Hyper 是一款终端美化工具 基于Web技术,JS/HTML/CSS ,支持扩展增强,很不错! 且支持win,mac 下载地址 ...
- P4_创建第一个小程序项目
设置外观和代理 创建小程序项目 点击"加号"按钮 填写项目信息 项目创建完成 在模拟器上查看项目效果 在真机上预览项目效果 主界面的 5 个组成部分
- k8s中使用prometheus operator监控外部服务器部署的windows exporter
k8s中使用prometheus operator监控外部服务器部署的windows exporter 0.文档说明 (1)Prometheus Operator是一个流行的k8s集群监控套件,项目地 ...
- JZOJ 3213. 【SDOI2013】直径
题目 思路 树的直径很好求,两遍 \(dfs\),记下两个端点 然后很显然所有直径经过的边必然在我们求出的这条直线上 那么我们只要判断一下一条直径上的边是不是答案 假设当前边为 \(i\) 那么把 \ ...
- Git基础操作及协作流程
一整套流程帮你实践整个 Git 操作基础流程. 来源:https://docs.microsoft.com/zh-cn/learn/paths/intro-to-vc-git/ Git 介绍 配置 G ...
- C#/.net程序调用python
C#/.net程序调用python C#的优势在于window下的开发,不仅功能强大而且开发周期短.而python则有众多的第三方库,可以避免自己造轮子,利用C#来做界面,而具体实现使用python来 ...