官方文档地址
部署
1. 下载与解压
下载 RocketMQ二进制文件 https://dlcdn.apache.org/rocketmq/4.9.3/rocketmq-all-4.9.3-bin-release.zip
yum install -y wget && wget https://dlcdn.apache.org/rocketmq/4.9.3/rocketmq-all-4.9.3-bin-release.zip
yum install -y unzip
unzip rocketmq-all-4.9.3-bin-release.zip -d /opt
cd /opt/rocketmq-4.9.3
mkdir logs
2. 编辑conf
需要配置一下CONF 方便启动
brokerIP1 = 10.0.0.111
namesrvAddr = 10.0.0.111:9876
storePathRootDir=/opt/rocketmq-4.9.3/store
#是否允许 Broker 自动创建Topic,建议线下开启,线上关闭
autoCreateTopicEnable=true
#是否允许 Broker 自动创建订阅组,建议线下开启,线上关闭
autoCreateSubscriptionGroup=true
3. 启动 mqnamesrv
nohup ./bin/mqnamesrv >/dev/null 2>&1 &
4. 启动 mqbroker
broker 可部署多套,生产环境 broker 要部署在不同的服务器上
nohup ./bin/mqbroker -n 服务器IP:9876 -c conf/broker.conf autoCreateTopicEnable=true >/dev/null 2>&1 &
5. 启动RocketMQ Dashboard(Docker版)
docker pull apacherocketmq/rocketmq-dashboard:latest
docker run --name rocketmq-dashboard --restart=always \
-e "JAVA_OPTS=-Drocketmq.namesrv.addr=10.0.0.159:9876" \
-p 9877:8080 -d -t apacherocketmq/rocketmq-dashboard:latest