Apache ActiveMQ浏览器无法连接到JMX控制台 [英] Apache ActiveMQ browser can't connect to JMX console

查看:548
本文介绍了Apache ActiveMQ浏览器无法连接到JMX控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Apache ActiveMQ版本5.8.0 ,并下载了 Apache ActiveMQ浏览器版本2.5.2.8

I am using Apache ActiveMQ version 5.8.0 and I downloaded Apache ActiveMQ Browser version 2.5.2.8

在Apache ActiveMQ内,我编辑了 activemq.xml 配置以使用JMX:

Within Apache ActiveMQ I edited the activemq.xml configuration to use JMX:

<broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" brokerName="localhost" dataDirectory="${activemq.data}">
  <!-- This needed to be set to true, otherwise JMX won't start in 5.8.0 -->
  <managementContext>
    <managementContext createConnector="true"/>
  </managementContext>
</broker>

在启动脚本中,我将JMX设置如下:

Within the startup script I set the JMX settings as follows:

#ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=11099 "
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"

当我重新启动Apache ActiveMQ时,日志显示JMX已启动并且可以访问:

When I restart Apache ActiveMQ, the log shows me the JMX is started and accessible:

JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi | org.apache.activemq.broker.jmx.ManagementContext | JMX connector

还要检查端口是否正在监听结果进入监听端口:

Also checking if the port is listening results into a listening port:

[me@server ~]$ netstat -lptun | grep 1099
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 :::1099                     :::*                        LISTEN      16775/java

Apache ActiveMQ在服务器上运行。例如在IP 10.0.0.100上。 Apache ActiveMQ浏览器在我的PC(10.0.0.200)上运行。

Apache ActiveMQ is running on a server. For example on IP 10.0.0.100. Apache ActiveMQ Browser runs on my PC (10.0.0.200).

当我尝试与Apache ActiveMQ Browser连接时,连接一直失败。我正在使用以下设置:

When I try to connect with Apache ActiveMQ Browser the connections keeps failing. I'm using the following settings:

 JMX URL: service:jmx:rmi:///jndi/rmi://10.0.0.100:1099/jmxrmi
 JMX role: admin
 JMS password: activemq

此刻,我默认将用户名和密码留在 jmx.password jmx.access 中。

I left the user and password at this moment as default in jmx.password and jmx.access.

在与腻子连接时,我还尝试为端口1099创建到本地端口1099的隧道,然后连接到 localhost 而不是 10.0.0.100 ,以确保没有防火墙是问题。但是一切都失败了。

I also tried when connecting with putty to create a tunnel for port 1099 to local port 1099 and then connect to localhost instead of 10.0.0.100 to be sure no firewall is the issue. But all fails.

我忘了什么吗?

推荐答案

不幸的是,JMX需要两个端口才能正常运行。第二个(RMI注册表端口)默认情况下是随机选择的,从而导致防火墙等问题。

Unfortunately, JMX needs two ports to operate properly. And the second one (the RMI registry port) is by default picked randomly causing problems with firewalls etc.

自JDK7u4起,您可以使用

Since JDK7u4 you can use

-Dcom.sun.management.jmxremote.rmi.port=<port>

设置要使用的RMI端口。

to set the RMI port to be used.

这篇关于Apache ActiveMQ浏览器无法连接到JMX控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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