下载地址
https://archive.apache.org/dist/rocketmq/4.9.0/rocketmq-all-4.9.0-bin-release.zip
修改conf/broker.conf
namesrvAddr=127.0.0.1:9876
启动
# ./mqnamesrv
nohup sh bin/mqnamesrv > logs/mqnamesrv.log 2>&1 &
# ./mqbroker -n localhost:9876
nohup sh bin/mqbroker -n 127.0.0.1:9876 -c ./conf/broker.conf >logs/mqbroker.log 2>&1 &
关闭
sh bin/mqshutdown broker
sh bin/mqshutdown namesrv
ps
https://github.com/apache/rocketmq-dashboard
WIndows 启动服务
1、修改 conf/broker.conf
namesrvAddr=127.0.0.1:9876
storePathRootDir=C:/work/soft/rocketmq-4.9.0/store
storePathCommitLog=C:/work/soft/rocketmq-4.9.0/store/commitlog
2、修改bin/runbroker.cmd
set "JAVA_OPT=%JAVA_OPT% -server -Xms2g -Xmx2g"
set "JAVA_OPT=%JAVA_OPT% -XX:MaxDirectMemorySize=15g"
set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%"
set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib;%JAVA_HOME%\jre\lib\ext"
# 分别改为
set "JAVA_OPT=%JAVA_OPT% -server -Xms512m -Xmx512m -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
set "JAVA_OPT=%JAVA_OPT% -XX:MaxDirectMemorySize=50m"
set "JAVA_OPT=%JAVA_OPT% -cp "%CLASSPATH%""
set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib;"%JAVA_HOME%"\jre\lib\ext"
3、修改bin/runserver.cmd文件
set "JAVA_OPT=%JAVA_OPT% -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib;%JAVA_HOME%\jre\lib\ext"
# 改为
set "JAVA_OPT=%JAVA_OPT% -server -Xms512m -Xmx512m -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib;"%JAVA_HOME%"\jre\lib\ext"
4、启动服务
管理员身份启动cmd命令窗口,在bin目录下分别输入:
start mqnamesrv.cmd
start mqbroker.cmd -n 127.0.0.1:9876 autoCreateTopicEnable=true
注:不要关闭两个新打开的cmd窗口
broker.log 日志 delayOffset.json 文件出错
{
"offsetTable":{}
}