基础篇
Linux基础搭建
单机版broker搭建
创建文件目录:
mkdir -p /home/rocketmq/store/broker-a /home/rocketmq/store/broker-a/consumequeue /home/rocketmq/store/broker-a/commitlog /home/rocketmq/store/broker-a/index /home/rocketmq/broker-a/logs
unzip rocketmq-all-4.8.0-bin-release.zip
mv rocketmq-all-4.8.0-bin-release rocketmq-4.8.0
修改配置文件:
vim broker.conf
listenPort=10911
autoCreateTopicEnable=true
autoCreateSubscriptionGroup=true
namesrvAddr=localhost:9876
storePathRootDir=/home/rocketmq/store/broker-a
storePathCommitLog=/home/rocketmq/store/broker-a/commitlog
storePathConsumeQueue=/home/rocketmq/store/broker-a/consumequeue
storePathIndex=/home/rocketmq/store/broker-a/index
storeCheckpoint=/home/rocketmq/store/broker-a/checkpoint
abortFile=/home/rocketmq/store/broker-a/abort
启动:
修改bin目录下的runbroker.sh 和 runserver.sh 文件
比如把8g 4g 改成512m, 4g 2g改成256m
cd /home/rocketmq/rocketmq-4.8.0/bin
nohup sh mqnamesrv &
nohup sh mqbroker -c /home/rocketmq/rocketmq-4.8.0/conf/broker.conf &
查看日志:
tail -f ~/logs/rocketmqlogs/namesrv.log
tail -f ~/logs/rocketmqlogs/broker.log
关闭服务:
cd /home/rocketmq/rocketmq-4.8.0/bin/
sh mqshutdown namesrv
sh mqshutdown broker
rocketmq-console搭建
cd /home/rocketmq/rocketmq-externals-master/rocketmq-console/src/main/resources
cd /home/rocketmq/rocketmq-externals-master/rocketmq-console
mvn clean package -Dmaven.test.skip=true
mvn clean package -Dcheckstyle.skip=true
cd target
nohup java -jar rocketmq-console-ng-2.0.0.jar &
其他信息
Producer:消息生产者 Producer Group:消息生产者组,发送同类消息的一个消息生产组 Consumer:消费者 Consumer Group:消费同个消息的多个实例 Tag:标签,子主题(二级分类),用于区分同一个主题下的不同业务的消息 Topic:主题 Message:消息 Broker:MQ程序,接收生产的消息,提供给消费者消费的程序 Name Server:给生产和消费者提供路由信息,提供轻量级的服务发现和路由
MQ大对比
https://blog.csdn.net/u010800804/article/details/113846163
|