jmx似乎不与activeMQ一起使用 [英] jmx doesnt seem to be working with activeMQ

查看:172
本文介绍了jmx似乎不与activeMQ一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我正在尝试将JMX与activeMQ一起使用进行监视,我一直在使用作为参考,但到目前为止我无法远程连接到jmx,而且在activemq日志中也看不到任何有关jmx网址的信息。我想知道是否还有另一种方法来确保jmx正常工作?是否应该在activemq日志中指出?
PS我正在使用jdk1.7和activeMQ 5.14.2。

I'm trying to use JMX with activeMQ for monitoring so far I've been using this and this as a reference but so far I'm unable to connect to jmx remotely and also I don't see any mention of jmx url in activemq logs. I'm wondering if there is another way to make sure jmx is working? is it supposed to be indicated in activemq logs? PS I'm using jdk1.7 and activeMQ 5.14.2.

谢谢!

编辑

我在我的activemq.xml文件中设置了useJmx = true:

I set useJmx="true" in my activemq.xml file:

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

我尝试了两个步骤:

我尝试将管理上下文从createConnector = false更改为:

I tried changing management context from createConnector="false" to :

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



第一次开放端口,ACTIVEMQ运行日志中报告的精细和JMX URL标记不将其连接到REMOTLEY,但要立即进行工作



第二



我恢复了所做的更改managmentContext,我尝试设置:

FOR FIRST TIME THE PORT IS OPEN AND ACTIVEMQ RUNS FINE AND JMX URL GETS REPORTED IN LOGS ALTHOUGH I CAN NOT CONNECT IT TO IT REMOTLEY BUT IM ASSUMING ITS WORKING

SECOND

I reverted back the changes I made for managmentContext and I tried setting:

ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_BASE}/jmx.password -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_BASE}/jmx.access"

我在conf / jmx.access文件为:

in bin/activemq script and I set a username in conf/jmx.access file as:

admin readwrite

并且还在conf / jmx.password中设置了密码:

And also have set a password in conf/jmx.password:

admin activemq




现在,ACTIVEMQ并不是全部运行如果我设置
AUTHENTICATE = FALSE并删除JMX.ACCESS和JMX.PASSWORD
在BIN / ACTIVEMQ文件中的配置,但是我需要用户名和密码
来进行安全原因
,它将运行我发现此帖子与我的问题完全相同。有任何想法吗?

NOW ACTIVEMQ IS NOT RUNNINT AT ALL BUT IT WILL RUN IF I SET AUTHENTICATE=FALSE AND DELETE JMX.ACCESS AND JMX.PASSWORD CONFIGURATION IN BIN/ACTIVEMQ FILE BUT I NEED USER NAME AND PASSWORD FOR SECURITY REASONS I found this post which has the exact same issue as mine. any ideas?


推荐答案

默认情况下,用于远程监控的密码身份验证处于启用状态。要禁用它,请在启动JVM时设置以下系统属性:
-Dcom.sun.management.jmxremote.authenticate = false,就像您在第二次测试中所做的一样,但是您需要添加系统属性-Dcom.sun.management .jmxremote

Password authentication for remote monitoring is enabled by default. To disable it, set the following system property when you start the JVM: -Dcom.sun.management.jmxremote.authenticate=false like you done in second test but you need to add system property -Dcom.sun.management.jmxremote

尝试将这些jvm参数添加到env文件并更新主机ip

Try to add these jvm param to env file and update host ip

-Djava.net。 preferredIPv4Stack = true -Djava.rmi.server.hostname = XXXX

-Djava.net.preferIPv4Stack=true -Djava.rmi.server.hostname=X.X.X.X

更新

SO,请继续,我认为您尝试的第一个步骤是最好的,要使其正常工作,请执行以下步骤:

SO, to resume, i think that the FIRST step you tried is the best, for making it working these are the steps :


  1. 还原所有jmx env文件更改,如下所示:

  1. revert all jmx env file changes, like this :


    # ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=1099 "
    # ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
    # ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
    # ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"



  • < ;经纪人useJmx = true ...




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


    验证AMQ日志中是否有

    verify that in AMQ logs you have


    信息| JMX控制台可以连接到
    服务:jmx:rmi:/// jndi / rmi:// localhost:1099 / jmxrmi |
    org.apache.activemq.broker.jmx.ManagementContext | JMX连接器

    注意:假设 10.10.10.16 是AMQ主机的IP。

    NOTE : Assuming that 10.10.10.16 is the IP of AMQ host.


    1. 尝试与之连接来自具有URL AMQ主机的另一台计算机上的jconsole service:jmx:rmi:/// jndi / rmi://10.10.10.16:1099 / jmxrmi 不带用户/密码。

    如果无法连接,请尝试如下操作:

    if you cannot connect, try like this :


    <managementContext>
      <managementContext createConnector="true"  connectorPort="1099"  connectorHost="10.10.10.16" />
    </managementContext>
    



  • 验证在AMQ日志中,您有

    verify that in AMQ logs you have


    INFO | JMX控制台可以连接到
    服务:jmx:rmi:/// jndi / rmi://10.10.10.16:1099 / jmxrmi |
    org.apache.activemq.broker.jmx.ManagementContext | JMX连接器




    1. 尝试连接,第4步

    1. retry to connect, step 4

    在此步骤通常可以与jconsole连接。

    at this step normally you can connect with jconsole.




    <managementContext>
      <managementContext  createConnector="true"  connectorPort="1099"  connectorHost="10.10.10.16" >
          <property xmlns="http://www.springframework.org/schema/beans" name="environment">
              <map xmlns="http://www.springframework.org/schema/beans">
                  <entry xmlns="http://www.springframework.org/schema/beans" key="jmx.remote.x.password.file"
                         value="${activemq.conf}/jmx.password"/>
                  <entry xmlns="http://www.springframework.org/schema/beans" key="jmx.remote.x.access.file"
                         value="${activemq.conf}/jmx.access"/>
              </map>
          </property>
      </managementContext>
    </managementContext>
    


    请尝试以下步骤,让我知道您在哪一个失败从jconsole连接并提供错误消息。

    Please try these steps and let me know in which one you fails to connect and provide error message from jconsole.

    这篇关于jmx似乎不与activeMQ一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆