共计 1177 个字符,预计需要花费 3 分钟才能阅读完成。
留神: 没有 docker 环境的能够参考自己的 centos 装置 docker
1. 查问有哪些能够用的 rocketMqdocker search rocketmq
2. 拉取镜像 docker pull rocketmqinc/rocketmq
3. 启动 namesrv 服务(新建文件门路我的是 /www/mq)
docker run -d -p 9876:9876 -v /www/mq/data/namesrv/logs:/root/logs -v /www/mq/data/namesrv/store:/root/store --name rmqnamesrv -e "JAVA_OPTS=-Duser.home=/opt" -e "JAVA_OPT_EXT=-server -Xms1024m -Xmx1024m" rocketmqinc/rocketmq sh mqnamesrv
4. 配置
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
namesrvAddr = 127.0.0.1:9876
brokerIP1 = 127.0.0.1
#是否容许 Broker 主动创立 Topic,倡议线下开启,线上敞开
autoCreateTopicEnable=true
#是否容许 Broker 主动创立订阅组,倡议线下开启,线上敞开
autoCreateSubscriptionGroup=true
5. 启动服务
docker run -d -p 10911:10911 -p 10909:10909 -v /www/mq/data/broker/logs:/root/logs -v /www/mq/rocketmq/data/broker/store:/root/store -v /www/mq/conf/broker.conf:/opt/rocketmq/conf/broker.conf --name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e "JAVA_OPTS=-Duser.home=/opt" -e "JAVA_OPT_EXT=-server -Xms1024m -Xmx1024m" rocketmqinc/rocketmq sh mqbroker
6. 装置控制台
docker run -e "JAVA_OPTS=-Drocketmq.config.namesrvAddr=127.0.0.1:9876 -Drocketmq.config.isVIPChannel=false" -p 9993:8080 -t styletang/rocketmq-console-ng
正文完