rocketmq docker
时间: 2023-09-30 21:12:42 浏览: 116
要使用RocketMQ Docker镜像部署RocketMQ,你可以按照以下步骤进行操作:
1. 首先,你需要创建一个用于存储RocketMQ数据的目录。你可以使用以下命令来创建这些目录:
```
mkdir -p /docker/rocketmq/data/broker/logs /docker/rocketmq/data/broker/store /docker/rocketmq/conf
```
2. 接下来,你需要运行`rmqnamesrv`容器来启动RocketMQ的Namesrv服务。你可以使用以下命令来运行容器:
```
docker run -d --restart=always --name rmqnamesrv --privileged=true -p 9876:9876 -v /docker/rocketmq/nameserver/logs:/root/logs -v /docker/rocketmq/nameserver/store:/root/store -e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq sh mqnamesrv
```
3. 然后,你需要运行`rmqbroker`容器来启动RocketMQ的Broker服务。你可以使用以下命令来运行容器:
```
docker run -d --restart=always --name rmqbroker --link rmqnamesrv:namesrv -p 10911:10911 -p 10909:10909 --privileged=true -v /docker/rocketmq/data/broker/logs:/root/logs -v /docker/rocketmq/data/broker/store:/root/store -v /docker/rocketmq/conf/broker.conf:/opt/docker/rocketmq/broker.conf -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq sh mqbroker -c /opt/docker/rocketmq/broker.conf
```
通过按照以上步骤,你可以使用RocketMQ Docker镜像来部署RocketMQ并运行Namesrv和Broker服务。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Docker安装RocketMQ详细教程](https://blog.csdn.net/w598882992/article/details/127509962)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [Rocketmq详解02-mq安装](https://blog.csdn.net/a2868221132/article/details/118156511)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文