Linux 安裝和配置ActiveMQ Artemis


1、ActiveMQ Artemis官網下載
https://activemq.apache.org/components/artemis/download/
當前版本2.20.0,不支持JDK8,JDK8需要下載版本2.19.0的,本人下載的是2.19.0
https://activemq.apache.org/components/artemis/download/past_releases

2、上傳安裝壓縮包apache-artemis-2.19.0-bin.tar.gz到服務器/opt目錄上

3、解壓

cd /opt
tar -zxvf apache-artemis-2.19.0-bin.tar.gz

4、創建Broker實例

cd apache-artemis-2.19.0/bin
./artemis create mybroker

輸出:

Creating ActiveMQ Artemis instance at: /opt/apache-artemis-2.19.0/bin/mybroker

之后會提示輸入默認用戶名、密碼、是否允許匿名登錄

--user:
Please provide the default username:
admin

--password: is mandatory with this configuration:
Please provide the default password:

--allow-anonymous | --require-login:
Allow anonymous access?, valid values are Y,N,True,False
N

輸入之后,輸出:

Auto tuning journal ...
done! Your system can make 62.5 writes per millisecond, your journal-buffer-timeout will be 16000

You can now start the broker by executing:

"/opt/apache-artemis-2.19.0/bin/mybroker/bin/artemis" run

Or you can run the broker in the background using:

"/opt/apache-artemis-2.19.0/bin/mybroker/bin/artemis-service" start

執行下面命令啟動Artemis

"/opt/apache-artemis-2.19.0/bin/mybroker/bin/artemis-service" start

5、修改Artemis配置

(1)修改 vim mybroker/etc/jolokia-access.xml

找到下面一行

<allow-origin>*://localhost*</allow-origin>

在它的下面添加一行訪問權限設置,例如

<allow-origin>*://172.16.21.3*</allow-origin>

(2)修改 vim mybroker/etc/bootstrap.xml

找到下面一行

<web bind="http://localhost:8161" path="web">

把里面的localhost修改為服務器IP

<web bind="http://172.16.21.3:8161" path="web">

(3)重啟Artemis

"/opt/apache-artemis-2.19.0/bin/mybroker/bin/artemis-service" restart

(4)檢查防火牆指是允開啟端口8161和61616,沒開啟則開啟

firewall-cmd --query-port=8161/tcp
firewall-cmd --zone=public --add-port=8161/tcp --permanent

firewall-cmd --query-port=61616/tcp
firewall-cmd --zone=public --add-port=61616/tcp --permanent

firewall-cmd --reload

6、登錄控制台

http://172.16.21.3:8161/console/login

用戶名及密碼為上面創建Broker實例時的用戶名及密碼

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM