原文:https://www.jianshu.com/p/04a98ba770a4
下载命令:wget https://mirrors.tuna.tsinghua.edu.cn/apache/rocketmq/4.2.0/rocketmq-all-4.2.0-bin-release.zip
解压命令:unzip -d /usr/local/rocketmq rocketmq-all-4.2.0-bin-release.zip
nameserver环境变量:
vi /etc/profile
添加:export NAMESRV_ADDR=127.0.0.1:9876
配置rocketmq的环境变量
vim /etc/profile
#设置rocketmq的环境变量
export ROCKETMQ_HOME=/usr/local/rocketmq
export PATH=$JAVA_HOME/bin:$ROCKETMQ_HOME/bin:$PATH
使rocketmq的配置生效
source /etc/profile
cd /usr/local/rocketmq/bin/
启动namesrv服务 nohup sh mqnamesrv &
查看日志 tail -f ~/logs/rocketmqlogs/namesrv.log
启动broker nohup sh mqbroker -n localhost:9876 &
tail -f ~/logs/rocketmqlogs/broker.log
nohup sh bin/mqbroker -n localhost:9876 -c conf/broker.conf &
查看进程:jps
关闭服务器
sh bin/mqshutdown broker //停止 broker
sh bin/mqshutdown namesrv //停止 nameserver
原文:https://blog.csdn.net/cdnight/article/details/81027829
出现的问题:
3.org.apache.rocketmq.client.exception.MQClientException: No route info of this topic, TopicTest
nohup sh mqbroker -n 127.0.0.1:9876 autoCreateTopicEnable=true &
nohup sh mqbroker -n 127.0.0.1:9876 autoCreateTopicEnable=true > ~/logs/rocketmqlogs/broker.log 2>&1 &
https://blog.csdn.net/weiwenjuan0923/article/details/84938770
2. namesrv总是启动失败的话,可能已经有启动的namesrv。关闭服务重新启动
1. 内存不足,好,测试环境调低一点内存容量。
vi runbroker.sh/
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn256m"
JAVA_OPT="${JAVA_OPT} -XX:MaxDirectMemorySize=256m"
vi runserver.sh
JAVA_OPT="${JAVA_OPT} -server -Xms128m -Xmx128m -Xmn128m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m"
原文:https://blog.csdn.net/DF_XIAO/article/details/50522476
rocketMQ简介及安装