Windows下RocketMQ安装部署
RocketMQ部署
快速开始:http://rocketmq.apache.org/docs/quick-start/
官方下载:http://rocketmq.apache.org/release_notes/release-notes-4.4.0/
(1)选择“Binary”进行下载
(2)解压已下载工程
(3)配置系统环境变量
变量名:ROCKETMQ_HOME
变量值:D:\Server\rocketmq-all-4.4.0-bin-release
(2)启动NAMESERVER
CMD命令行执行进入至“MQ文件夹\bin”下,然后执行start mqnamesrv.cmd
,启动NAMESERVER。成功后会弹出提示框,此框勿关闭。
> cd D:\Server\rocketmq-all-4.4.0-bin-release\bin
> start mqnamesrv.cmd
Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
The Name Server boot success. serializeType=JSON
(5)启动BROKER
Cmd命令框执行进入至“MQ文件夹\bin”下,然后执行start mqbroker.cmd -n 127.0.0.1:9876 autoCreateTopicEnable=true
,启动BROKER。成功后会弹出提示框,此框勿关闭。
> start mqbroker.cmd -n 127.0.0.1:9876 autoCreateTopicEnable=true
The broker[YEZHOU.ME, 10.3.10.114:10911] boot success. serializeType=JSON and name server is 127.0.0.1:9876
假如弹出提示框提示“错误: 找不到或无法加载主类 xxxxxx”。打开runbroker.cmd,然后将%CLASSPATH%
加上英文双引号。保存并重新执行start语句。
RocketMQ插件部署
(1)下载地址:https://github.com/apache/rocketmq-externals.git
(2)进入rocketmq-externals\rocketmq-console\src\main\resources
文件夹,打开application.properties
进行配置
server.contextPath=
server.port=8088 //配置插件工程端口
#spring.application.index=true
spring.application.name=rocketmq-console
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
logging.config=classpath:logback.xml
#if this value is empty,use env value rocketmq.config.namesrvAddr NAMESRV_ADDR | now, you can set it in ops page.default localhost:9876
rocketmq.config.namesrvAddr=127.0.0.1:9876 //配置MQ地址(默认端口为9876)
#if you use rocketmq version < 3.5.8, rocketmq.config.isVIPChannel should be false.default true
rocketmq.config.isVIPChannel=
#rocketmq-console's data path:dashboard/monitor
rocketmq.config.dataPath=/tmp/rocketmq-console/data
#set it false if you don't want use dashboard.default true
rocketmq.config.enableDashBoardCollect=true
#set the message track trace topic if you don't want use the default one
rocketmq.config.msgTrackTopicName=
(3)修改rocketmq-console/pom.xml
把pom文件中rocketmq的version改成4.4.0即可
<rocketmq.version>4.4.0-SNAPSHOT</rocketmq.version>
改为
<rocketmq.version>4.4.0</rocketmq.version>
参考:https://github.com/apache/rocketmq-externals/issues/208
(4)编译启动
进入\rocketmq-externals\rocketmq-console
文件夹,执行mvn clean package -Dmaven.test.skip=true
,编译生成
编译成功之后,CMD进入target
文件夹,执行java -jar rocketmq-console-ng-1.0.0.jar
,启动rocketmq-console-ng-1.0.0.jar
D:\Server\rocketmq-externals\rocketmq-console> mvn clean package -Dmaven.test.skip=true
D:\Server\rocketmq-externals\rocketmq-console> cd target
D:\Server\rocketmq-externals\rocketmq-console\target> java -jar rocketmq-console-ng-1.0.0.jar
(5)测试:浏览器中输入127.0.0.1:8088
,成功后即可查看
版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/02/26/rocketmq-installation-and-deployment-under-windows/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论