我已经在 Ambari HDP 上部署了 HBase。我尝试使用 JMX 导出器获取 HBase 指标,因此我在“hbase-env”中添加了下一个配置:
export HBASE_OPTS="$HBASE_OPTS -javaagent:/opt/jmx_exporter/jmx_exporter_javaagent.jar=7174:/opt/jmx_exporter/hbase/hbase.yml"
我运行 HBase 没有问题,但是当我尝试访问 hbase shell 时,它会引发下一个错误:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:497)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent (InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain (InstrumentationImpl.java:401)
Caused by: java.net.BindException: The address is already being used
at sun.nio.ch.Net.bind0 (Native Method)
at sun.nio.ch.Net.bind (Net.java:437)
at sun.nio.ch.Net.bind (Net.java:429)
at sun.nio.ch.ServerSocketChannelImpl.bind (ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind (ServerSocketAdaptor.java:74)
at sun.net.httpserver.ServerImpl.bind (ServerImpl.java:133)
at sun.net.httpserver.HttpServerImpl.bind (HttpServerImpl.java:54)
at io.prometheus.jmx.shaded.io.prometheus.client.exporter.HTTPServer. <init> (HTTPServer.java:145)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain (JavaAgent.java:49)
... 6 more
FATAL ERROR in native method: processing of -javaagent failed
Aborted
我已经尝试更改 JMX 导出器的端口,但总是抛出 BindException。如果我在 Hbase-env 中删除 JMX 导出器的行,它工作正常,我可以访问 hbase shell。