JMX:rmiPort和registryPort相同吗? [英] JMX : rmiPort and registryPort the same?

查看:159
本文介绍了JMX:rmiPort和registryPort相同吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试尽可能深入地学习JMX.

I'm trying to learn JMX as deep as possible.

我已经阅读了许多有关如何显式设置JMX服务器使用的端口号的博客文章.您可能已经知道实际上需要两个端口:一个用于注册表,另一个用于RMI协议流量.最近,我发现了此博客文章表示可以将两个端口设置为相同,因此您只需要在防火墙上打一个孔即可.我必须承认,我认为它永远都行不通.我确信它将创建套接字已绑定"异常或类似的东西.但这确实有效!

I've read many blog posts about how to explicitly set the port numbers used by the JMX server. As you may be aware there are actually two ports required: One for the Registry and one for RMI protocol traffic. Recently I discovered this blog post which suggests that the two ports can be set to the same so that you only have to punch one hole in the firewall. I must admit I thought it would never work. I was certain that it would create a "socket already bound" exception or something like that. But it does work!

问题:

  1. 为什么起作用?为什么注册表可以与使用的rmi协议流量位于同一端口上?

  1. Why does it work? Why can the Registry live on the same port as is used rmi protocol traffic?

鉴于这行得通,为什么我永远希望它们位于不同的端口上. (假设始终使用最新的Java7)

Given that this works why would I ever want them to be on different ports. (assuming always using Java7 latest)

推荐答案

从同一JVM导出的所有远程对象(包括注册表)都可以共享同一端口.这是RMI的基本功能.

All remote objects, including the Registry, exported from the same JVM can share the same port. This is a basic feature of RMI.

例如,您只希望它们在不同的端口上一个使用SSL,一个没有使用SSL,或者它们使用的是不同的JVM

You would only want them on different ports if e.g. one used SSL and one didn't, or if they were in different JVMs

这篇关于JMX:rmiPort和registryPort相同吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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