Docker環境下ActiveMQ安裝、連接

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, --detach Run container in background and print container ID(後臺運行容器,並且打印容器id)
-i, --interactive Keep STDIN open even if not attached(保持標準輸入,即使沒有連上容器)
–name string Assign a name to the container(給容器指定名稱)
-p, --publish list Publish 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賬號密碼即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章