ROCKETMQ
配置环境变量(ROCKETMQ_HOME)#
修改runserver.cmd#
1、进入bin目录下找到runserver.cmd文件,用编辑器打开,因为RocketMQ默认需要2g运行内存,做为测试用,就只要最低配置就好了,注释原有的NameServer 的配置,在其前面加上rem 注释掉,
rem set "JAVA_OPT=%JAVA_OPT% -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
在后面加上
set "JAVA_OPT=%JAVA_OPT% -server -Xms256m -Xmx512m"
2、双击 mqnamesrv.cmd 文件 NameServer 的默认端口是9876
3、配置broker排位置文件#
a.用编辑器打开runbroker.cmd文件
注释默认配置,在其前面加上
rem set "JAVA_OPT=%JAVA_OPT% -server -Xms2g -Xmx2g -Xmn1g"
并在后面配置
set "JAVA_OPT=%JAVA_OPT% -server -Xms256m -Xmx512m"
b.配置NameServer地址
rem 指定NameServer的地址
set "NAMESRV_ADDR=localhost:9876"
rem 添加NameServer的地址
call "%ROCKETMQ_HOME%\bin\runbroker.cmd" org.apache.rocketmq.broker.BrokerStartup %*
查看 是否有集群注册#
.\mqadmin.cmd clusterList -n localhost:9876
-
修改 conf 文件夹中的 broker.conf 文件#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 集群名字
brokerClusterName = DefaultCluster
# 使用的broker-a.properties配置,名字和配置文件一致
brokerName = broker-a
# 0表示master,大于0表示slave
brokerId = 0
# 删除文件时间,默认为凌晨4点
deleteWhen = 04
# 文件保留时间,默认为48小时
fileReservedTime = 48
# broker角色:ASYNC_MASTER异步复制Master SYNC_MASTER同步双写Master
brokerRole = ASYNC_MASTER
# 刷盘方式:ASYNC_FLUSH异步刷盘 SYNC_FLUSH同步刷盘
flushDiskType = ASYNC_FLUSH
# 允许自动创建topic
autoCreateTopicEnable=true
# 允许自动创建订阅组
autoCreateSubscriptionGroup=true
# 对外服务的监听端口
listenPort=10911
# 检测磁盘空间,低于该值就会导致消息接收失败
diskMaxUsedSpaceRatio=99
# store存储路径
storePathRootDir=D:\RocketMQ\log\store
# commitlog存储路径
storePathCommitLog=D:\RocketMQ\log\store\commitlog
# 消费队列存储路径
storePathConsumeQueue=D:\RocketMQ\log\store\consumequeue
# 消息索引存储路径
storePathIndex=D:\RocketMQ\log\store\index
# checkpoint文件存储路径
storeCheckpoint=D:\RocketMQ\log\store\checkpoint
# abort文件存储路径
abortFile=D:\RocketMQ\log\store\abort
图形化界面:#
idea运行就行
作者:Esofar
出处:https://www.cnblogs.com/firsthelloworld/p/17443910.html
版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本