1. 程式人生 > >activemq配置安裝

activemq配置安裝

cti tco put prop https sharp block down lock

1、了解JMS查看百度百科

https://baike.baidu.com/item/JMS/2836691?fr=aladdin

2、了解ActiveMQ

https://baike.baidu.com/item/ActiveMQ

3、mq的安裝

  1、首先去http://activemq.apache.org/download.html 下載最新版本5.15.5release, 解壓apache-activemq-5.15.5-bin.zip(或者apache-activemq-5.15.5-bin.tar.gz)

  2、放到安裝的路徑進行解壓

tar -zxvf apache-activemq-5.15.5-bin.tar.gz  

  3、修改端口(不改為默認端口)

    ActiveMQ 需要用到兩個端口

    一個是消息通訊的端口(默認為 61616)

    打開conf目錄下得到activemq.xml的配置文件,找到下面這端代碼,把61616替換成你的新端口號    

<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>

<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

一個是管理控制臺端口(默認為 8161)可在 conf/jetty.xml 中修改,如下:

<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start"> 
  <!-- the default port number for the web console --> 
  <property name="host" value="0.0.0.0"/>
service iptables restart 

  

<property name="port" value="8161"/> </bean>

4、修改防火墻打開對應端口

vi /etc/sysconfig/iptables   

添加

-A INPUT -m state --state NEW -m tcp -p tcp --dport 61616 -j ACCEPT 
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8161 -j ACCEPT 

重啟防火墻:

service iptables restart 

5、啟動:ActiveMQ/bin下

./activemq start 

6、查看是否啟動成功

查看activemq端口是否打開(默認61616)

netstat -an | grep 61616 

或者直接訪問:http://127.0.0.1:8161/admin(ip是安裝的IP地址)

用戶名:admin 密碼:admin

出現此圖成功

 技術分享圖片

activemq配置安裝