首页 > 其他分享 >rocketmq-exporter部署记

rocketmq-exporter部署记

时间:2023-02-07 18:04:06浏览次数:53  
标签:exporter 部署 boot build org docker rocketmq

简单介绍

rocketmq_exporter是prometheus提供的用于监控rocketmq运行状态的exporter

环境

系统版本
CentOS 7.6.1810 (Core)
CPU/内存 4核、8G
 

clone已有软件包,自行mvn

git clone https://github.com/apache/rocketmq-exporter [root@ecs rocketmq-exporter]# pwd /opt/rocketmq-exporter vim pom.xml 0   <?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地址即可,集群用;隔开) 0 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的方法,有问题联系博主,后续也有其他插件,欢迎交流

 

标签:exporter,部署,boot,build,org,docker,rocketmq
From: https://www.cnblogs.com/muyi-yang/p/17099314.html

相关文章

  • RocketMQ Streams拓扑构建与数据处理过程
    本文作者:倪泽,ApacheRocketMQcommitter、RSQLDB/RocketMQStreamsMaintainer01背景RocketMQStreams1.1.0版本已于近期发布,相对之前版本有以下改进和优化:1、API层面支持......
  • 消息队列部署选择
    部署是单机还是集群呢?你们高可用是怎么保证的呢?如果有人问到你MQ的知识,高可用是必问的。上一讲提到,MQ会导致系统可用性降低。所以只要你用了MQ,接下来问的一些要点......
  • centos7+nginx+uwsgi+python3.7.4+django部署实践
    yuminstallpython3yuminstallpython3-develyum-yinstallgccgcc-c++pip3installuwsgipython3​​manage.py​​runserver10.5.1.65:82uwsgi--iniuwsgi.i......
  • 外卖CPS小程序部署指南,个人获取美团外卖小程序跳转链接
    大家好,我是小悟上次利用闲暇时间弄了个外卖CPS小程序,并把代码开源出来,还是有挺多小伙伴来领取源码的。不仅有同行的人,还有跨行的人,也摸索着搞出来小程序推一推。有几个小伙......
  • 线上项目的服务部署
     跨服的部署:1跨服节点1的节点:route、manage、db、idip、common2 跨服节点2-3的节点:route、manage、db、idip3 跨服节点4-10的节点:route、manage、......
  • RocketMQ Streams 1.1.0: 轻量级流处理再出发
    本文作者:倪泽,ApacheRocketMQcommitter、RSQLDB/RocketMQStreamsMaintainer01背景RocketMQStreams是一款基于RocketMQ为基础的轻量级流计算引擎,具有资源消耗少、部......
  • k8s部署xxl-job-admin
    概述XXL-JOB是一个轻量级分布式任务调度平台,其核心设计目标是开发迅速、学习简单、轻量级、易扩展。现已开放源代码并接入多家公司线上产品线,开箱即用。xxl-job-admin需......
  • 基于k8s的kafka部署
    1.官方  https://kafka.apache.org2.k8s部署2.1.编译镜像DockerfileENVKAFKA_USER=kafka\KAFKA_DATA_DIR=/var/lib/kafka/data\JAVA_HOME=/usr/lib/jvm/java......
  • 一步步调教Cobbler安装、配置、部署
    原地址:https://blog.csdn.net/TzuHenry_AZ/article/details/1218836041.准备环境:关闭防火墙、配好yum源、服务器配好IP、SElinux关闭。2.安装epel源:[root@solomon11:49......
  • Nginx前端部署配置
    Nginx部署(针对vue项目)运行打包命令生成dist文件:npmrundev打开nginx.conf文件,配置对应的信息#nginx.conflocation/{rootC:\Users\Desktop\project\dist......