Docker环境下ActiveMQ安装、连接

本文详细介绍了如何在Docker环境中安装和配置ActiveMQ消息队列服务,包括选择镜像、运行容器、开放端口及访问管理界面的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Docker环境下ActiveMQ安装、连接

一、搜索activemq镜像

# 搜索activemq镜像
docker search activemq 
[root@chushiyan ~]# docker search activemq
INDEX       NAME                                               DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/webcenter/activemq                       ActiveMQ 5.14.3 with OpenJDK-jre-8-headles...   172                  [OK]
docker.io   docker.io/rmohr/activemq                           Various versions of ActiveMQ neatly packet...   107                  [OK]
docker.io   docker.io/vromero/activemq-artemis                 ActiveMQ Artemis image (Debian and Alpine ...   23                   [OK]
docker.io   docker.io/cloudesire/activemq                      Latest activemq                                 4                    [OK]
docker.io   docker.io/andreptb/activemq                        Debian Jessie based image with ActiveMQ in...   3                    [OK]
docker.io   docker.io/aterreno/activemq-dockerfile                                                             3                    [OK]
docker.io   docker.io/antonw/activemq-jmx                      ActiveMQ with (remote) JMX                      1                    [OK]
docker.io   docker.io/ddmlu/activemq-openshift                 Fork of ayannah/activemq for openShift          1                    [OK]
docker.io   docker.io/jtech/activemq                           Latest ActiveMQ production distribution on...   1                    [OK]
docker.io   docker.io/spacetimeinsight/activemq                activemq                                        1                    
docker.io   docker.io/tremolosecurity/activemq-docker          Hardened version of ActiveMQ for use with ...   1                    [OK]
docker.io   docker.io/albertonavarro/activemq12s                                                               0                    
docker.io   docker.io/aomitech/activemq-client                                                                 0                    
docker.io   docker.io/aungzy/activemq                          Docker image for ActiveMQ, forked from htt...   0                    [OK]
docker.io   docker.io/ayannah/activemq                         Dockerized ActiveMQ                             0                    [OK]
docker.io   docker.io/beeyond/activemq                         ActiveMQ MySQL                                  0                    
docker.io   docker.io/bgbilling/activemq                       Apache ActiveMQ                                 0                    [OK]
docker.io   docker.io/camptocamp/activemq-mcollective          Activemq image for mcollective                  0                    [OK]
docker.io   docker.io/cloudunit/activemq-5.13                  activemq-5.13                                   0                    [OK]
docker.io   docker.io/duffqiu/activemq-edge                                                                    0                    [OK]
docker.io   docker.io/duffqiu/activemq-hub                                                                     0                    [OK]
docker.io   docker.io/joakimgreenbird/activemq-bridge          Bridge from kafka to activemq.                  0                    
docker.io   docker.io/kibiluzbad/activemq-artemis-operator     ActiveMQ Artemis Operator                       0                    
docker.io   docker.io/larrytalley/activemq-docker-deployable   Deployable instance of Apache ActiveMQ ins...   0                    [OK]
docker.io   docker.io/smaject/activemq                         Apache ActiveMQ based on CentOS 7               0                    [OK]

二、安装运行activemq容器

没有官方的activemq镜像(OFFICIAL显示[OK]即是官方 ),所以这里安装STARS最多的:

docker run -di --name=my_activemq \
-p 61616:61616 \
-p 8161:8161 \
webcenter/activemq

参数说明:

参数描述
-d, --detachRun container in background and print container ID(后台运行容器,并且打印容器id)
-i, --interactiveKeep STDIN open even if not attached(保持标准输入,即使没有连上容器)
–name stringAssign a name to the container(给容器指定名称)
-p, --publish listPublish a container’s port(s) to the host (default [])(将容器的端口映射到宿主机的端口上,可以映射多个端口)

三、开放端口:

# 开放端口
iptables -I INPUT -p tcp -m tcp --dport 61616 -j ACCEPT
iptables -I INPUT -p udp -m udp --dport 61616 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 8161 -j ACCEPT
iptables -I INPUT -p udp -m udp --dport 8161 -j ACCEPT
iptables-save

如果是阿里云、亚马逊云主机等还得在防火墙放行。

四、访问后台界面

访问

http://192.168.0.1:8161/admin/

输入默认的admin/admin账号密码即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值