Docker上安装RockerMq

第一步

#创建broker配置文件 
vim /rmq/rmqbroker/conf/broker.conf 
brokerIP1=172.16.55.* 
namesrvAddr=172.16.55.*:9876 
brokerName=broker_test

第二步拉取及创建

#拉取镜像 
docker pull foxiswho/rocketmq:server-4.3.2 
docker pull foxiswho/rocketmq:broker-4.3.2 
#创建nameserver容器 
docker create -p 9876:9876 --name rmqserver \ 
-e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m -Xmn128m" \ 
-e "JAVA_OPTS=-Duser.home=/opt" \ 
-v /rmq/rmqserver/logs:/opt/logs \ 
-v /rmq/rmqserver/store:/opt/store \ 
foxiswho/rocketmq:server-4.3.2


#创建broker容器 
docker create -p 10911:10911 -p 10909:10909 --name rmqbroker \ 
-e "JAVA_OPTS=-Duser.home=/opt" \ 
-e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m -Xmn128m" \ 
-v /rmq/rmqbroker/conf/broker.conf:/etc/rocketmq/broker.conf \ 
-v /rmq/rmqbroker/logs:/opt/logs \ 
-v /rmq/rmqbroker/store:/opt/store \ 
foxiswho/rocketmq:broker-4.3.2 
#启动容器 
docker start rmqserver rmqbroker 
#停止删除容器 
docker stop rmqbroker rmqserver 
docker rm rmqbroker rmqserver

查看是否启动成功

docker logs rmqbroker 
docker logs rmqserver

需要开放端口

10909,10911,9876

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页