java Jconsole无法连接到本地jmx应用程序
我有一个Spring boot项目,我使用Spring boot启动器执行器和io。dropwizard。指标
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</dependency>
它生成我可以通过url http://myapplication/metrics访问的指标。 我将应用程序部署在Wildfly 10独立服务器上
我想使用jmx读取jconsole上的指标。 我将应用程序配置为使用JMXReporter发送度量:
@Configuration
@EnableMetrics
public class MetricsConfiguration extends MetricsConfigurerAdapter {
@Override
public void configureReporters(MetricRegistry metricRegistry) {
registerReporter(JmxReporter.forRegistry(metricRegistry)
.build())
.start();
}
}
当我启动服务器并部署应用程序时,日志显示:
o.s.b.a.e.j.EndpointMBeanExporter Located managed bean 'metricsEndpoint': registering with JMX server as MBean [portal-ws-jmx:type=Endpoint,name=metricsEndpoint]
当我运行jconsole时,在本地进程列表中,只有jconsole进程和一些灰色PID。如果我选择一个灰色PID,它会显示“管理代理在此过程中未启用”
我还尝试使用远程进程连接:
- 服务:jmx:http远程处理-jmx://localhost:9990
- 服务:jmx:remote+http://localhost:9990
- 本地主机:9990
但这不管用
我试图设置jvm变量:
- -Dcom。太阳经营jmxremote-Dcom。太阳经营jmxremote。地方的only=false
以及财产:
- 春天。jmx。启用=真
它也不起作用
使用jconsole读取jmx指标时我能做什么
共 (0) 个答案