docker-compose.yml安装rockermq
时间: 2023-11-17 14:01:59 浏览: 146
可以使用docker-compose.yml文件来安装Rockermq,具体步骤如下:
```
version: '3'
services:
namesrv:
image: rocketmqinc/rocketmq:4.9.0
container_name: rocketmq-namesrv
command: sh mqnamesrv
ports:
- "9876:9876"
volumes:
- ./data/namesrv/logs:/root/logs
- ./data/namesrv/store:/root/store
broker:
image: rocketmqinc/rocketmq:4.9.0
container_name: rocketmq-broker
command: sh mqbroker -c /opt/rocketmq-4.9.0/conf/broker.conf
ports:
- "10909:10909"
- "10911:10911"
volumes:
- ./data/broker/logs:/root/logs
- ./data/broker/store:/root/store
depends_on:
- namesrv
```
以上是一个简单的docker-compose.yml文件,其中包含了namesrv和broker两个服务,分别用于启动namesrv和broker。在使用该文件之前,需要先安装Docker和Docker Compose。安装完成后,只需要在该文件所在的目录下运行以下命令即可启动Rockermq:
```
docker-compose up -d
```
阅读全文