windows activemq 開啓遠程jmx連接

1、在config中,找到activemq.xml,在broker節點增加useJmx="true"

 

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">

managementContext配置端口

 

<managementContext createConnector="true" connectorPort="10099"/>

2、activemq-5.15.4版本,64位啓動方式爲\bin\win64\activemq.bat,這裏實際調用的是本目錄下的wrapper.exe,使用配置文件爲wrapper.conf,所以需要修改wrapper.conf。

在# Uncomment to enable remote jmx下,新增如下記錄,

 

# Uncomment to enable remote jmx
wrapper.java.additional.13=-Dcom.sun.management.jmxremote.port=10099
wrapper.java.additional.14=-Dcom.sun.management.jmxremote.authenticate=true
wrapper.java.additional.15=-Dcom.sun.management.jmxremote.ssl=false
wrapper.java.additional.16=-Djava.rmi.server.hostname=192.168.242.233
wrapper.java.additional.17=-Dcom.sun.management.jmxremote.password.file="%ACTIVEMQ_CONF%/jmx.password"
wrapper.java.additional.18=-Dcom.sun.management.jmxremote.access.file="%ACTIVEMQ_CONF%/jmx.access"

如activemq啓動是報錯,必須限制口令文件讀取訪問,

WINDOWS 解決方法:

   假設你的登錄用戶爲:Administrator

   執行如下命令:

C:\apache-activemq-5.5.0\bin>cacls ../conf/jmx.password /P Administrators:R

是否確定(Y/N)?Y
處理的文件: C:\apache-activemq-5.5.0\conf\jmx.password
C:\apache-activemq-5.5.0\bin>cacls ../conf/jmx.access /P Administrators:R
是否確定(Y/N)?Y
處理的文件: C:\apache-activemq-5.5.0\conf\jmx.access

 

  1. 這樣就可以正常使用了.

   登錄的用戶名/密碼在jmx.password裏,默認爲:admin/activemq,啓動jconsole,連接裏需要用戶驗證.

 

參考:

https://www.jianshu.com/p/68f9d54d6ff6

https://blog.csdn.net/heweiyabeijing/article/details/83909422

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