ssl - 通过 SSL 与 Gemfire 的 JMX 连接

标签 ssl jmx gemfire

我已经使用 GFSH 来启动定位器,如下所示

start locator --name=gemfire_locator --security-properties-file="../config/gfsecurity.properties" --J=-Dgemfire.ssl-enabled-components=all --mcast-port=0 --J=-Dgemfire.jmx-manager-ssl=true

同时启动服务器

start server --name=server1 --security-properties-file="../config/gfsecurity.properties" --J=-Dgemfire.ssl-enabled-components=all --mcast-port=0 --J=-Dgemfire.jmx-manager-ssl=true

我正在尝试连接到 Gemfire 作为 ClientCache,它在 SSL 上工作得很好。但是当我作为 JMX 客户端连接时,我在 Java 代码和 Jconsole 中遇到以下错误。

Error: 
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
    at SamplePlugin.main(SamplePlugin.java:101)

我是否缺少任何其他配置?

这是我的 JAVA_TOOL_OPTIONS:

-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=true
-Djava.rmi.server.hostname=myhostname

最佳答案

您还需要将 geode-core jar 添加到 jvisualvm 的类路径中。使用 --cp:a 选项。我建议只使用 geode-dependencies.jar,因为这将获得您可能需要的一切。

需要这样做的原因在 ContextAwareSSLRMIClientSocketFactory 的评论中有一些解释。 .基本上,当 RMI 使用 SSL 时,必要的 RMIClientSocketFactory 似乎从 server 导出到客户端以供在那里使用。一般来说,这只是 SslRMIClientSocketFactory。但在我们的例子中,我们有一个自定义套接字工厂,因此客户端(在本例中为 jvisualvm)需要访问它。

关于ssl - 通过 SSL 与 Gemfire 的 JMX 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54569523/

相关文章:

amazon-web-services - 使用 Gatling 进行负载测试时 TLS 握手超时

java - 启用 JMX 的 Tomcat7 打开 2 个额外的随机监听端口

java - JMX/RMI,其中服务器没有全局唯一的网络名称

caching - 需要通过多键查找持久保存在内存缓存中

java - @CacheEvict 的 Gemfire EntryNotFoundException

c# - Bouncy CaSTLe TLS API 用法

apache - 让我们在 Ubuntu 16 apache 服务器上加密 SSL 返回 404 错误

java - Spring Data Gemfire 存储 java.lang.Class 字段

java - 解密由 Java HttpsURLConnection 生成的 Wireshark 中的客户端 SSL 流量

java - 缺少 Websphere NodeAgent JMX MBean