Docker系列之Apache RocketMQ安装教程

Docker系列之Apache RocketMQ安装教程

  • 64bit JDK 1.8
  • Docker version 1.13.1

1、查找安装rocketmq

[root@localhost ~]# docker search rocketmq
INDEX       NAME                                           DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/rocketmqinc/rocketmq                 Image repository for Apache RocketMQ            46                   
docker.io   docker.io/foxiswho/rocketmq                    rocketmq                                        40                   
docker.io   docker.io/styletang/rocketmq-console-ng        rocketmq-console-ng                             33                   
...             

选取start最多的rocketinc

docker pull rocketmqinc/rocketmq

2、启动rocketmq mqnamesrv

docker run -d -p 9876:9876 -v /root/rocketmq/data/namesrv/logs:/root/logs -v /root/rocketmq/data/namesrv/store:/root/store --name rmqnamesrv -e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq sh mqnamesrv
[root@localhost conf]# docker run -d -p 9876:9876 -v /root/rocketmq/data/namesrv/logs:/root/logs -v /root/rocketmq/data/namesrv/store:/root/store --name rmqnamesrv -e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq sh mqnamesrv
2c168155664fbd046bbac17dba9bae01e9a9bd856b73cd75f14c16c18c2da67b
[root@localhost conf]# docker start rmqnamesrv
rmqnamesrv
[root@localhost conf]# docker ps
CONTAINER ID        IMAGE                  COMMAND             CREATED             STATUS              PORTS                                          NAMES
2c168155664f        rocketmqinc/rocketmq   "sh mqnamesrv"      20 seconds ago      Up 17 seconds       10909/tcp, 0.0.0.0:9876->9876/tcp, 10911/tcp   rmqnamesrv

3、启动rocketmq broker

[root@localhost ~]# cd /root/rocketmq/conf
[root@localhost conf]# touch broker.conf
[root@localhost conf]# vi broker.conf
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 192.168.7.159

启动broker

docker run -d -p 10911:10911 -p 10909:10909 -v  /root/rocketmq/data/broker/logs:/root/logs -v  /root/rocketmq/data/broker/store:/root/store -v  /root/rocketmq/conf/broker.conf:/opt/rocketmq/conf/broker.conf --name rmqbroker -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq sh mqbroker -c /opt/rocketmq/conf/broker.conf
docker start rmqbroker

4、启动rmqconsole

docker search rocketmq-console

docker pull styletang/rocketmq-console-ng  

docker run -d --name rmqconsole -p 9800:8080 -e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -t styletang/rocketmq-console-ng

在这里插入图片描述

smileNicky CSDN认证博客专家 分布式 Java Spring
java程序员,软件工程专业,专注于sql调优,SpringBoot,spring框架学习,个人邮箱nickypm@foxmail.com,公众号nickymp
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 岁月 设计师:pinMode 返回首页
实付 9.90元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值