Apache ActiveMQ浏览器无法连接到JMX控制台

编程入门 行业动态 更新时间:2024-10-22 02:48:26
本文介绍了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="activemq.apache/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控制台

本文发布于:2023-11-25 22:47:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631652.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   连接到   浏览器   Apache   ActiveMQ

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!