我已经在Ambari HDP上部署了HBase。我尝试使用JMX exporter获取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。
发布于 2019-06-10 22:43:59
基于下一篇文章:https://blog.godatadriven.com/hbase-prometheus-monitoring,我在/usr/bin/hbase中添加了以下内容,因此如果端口可用,它只在第一次导出指标。
if [ `lsof -n -i:7000 | grep LISTEN | wc -l` == "0" ]; then
export HBASE_OPTS="$HBASE_OPTS -javaagent:/opt/jmx_exporter/jmx_exporter_javaagent.jar=7000:/opt/jmx_exporter/hbase/hbase.yml"
fi问题是,每次您尝试启动HBase的服务时,都会出现端口冲突,因此启动失败。
发布于 2021-07-13 15:38:06
我也一样。即使我把下面的代码放在/bin/hbase中,我仍然得到这个错误:
root@xxx ~# hbase shell检查端口7000 -端口7000未使用-使用端口7000用法:-javaagent:/path/to/JavaAgent.jar=主机::收集器已注册,提供名称: jmx_exporter_build_info
对于{7000..8010}中的端口;执行
if [ `lsof -n -i:$port | grep LISTEN | wc -l` == "1" ]; then
echo "Checking port $port - port $port in use"
else
echo "Checking port $port - port $port not in use - using port $port"
export HBASE_OPTS="$HBASE_OPTS -javaagent:/hdptmp/jmx_prometheus_javaagent-0.16.0.jar=$port:/hdptmp/hbase_jmx_config.yaml"
break
fi完成
https://stackoverflow.com/questions/56522725
复制相似问题