prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption
Apache License 2.0
3.01k stars 1.2k forks source link

Hive Metastore JMX Exporter #526

Closed Asturias-sam closed 3 years ago

Asturias-sam commented 3 years ago

Currently i am using hive metastore and want to monitor it via Prometheus so to enable JMX monitoring i added these line in hive-env.sh

export HIVE_METASTORE_HADOOP_OPTS="$HIVE_METASTORE_HADOOP_OPTS -Djava.net.preferIPv4Stack=true -javaagent:/jmx_prometheus_javaagent-0.13.0.jar=[::]:9183:/check.yml"

I started the metastore using bin/hive --service metastore, i am getting the below error:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
    at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.net.SocketException: Protocol family unavailable
    at java.base/sun.nio.ch.Net.bind0(Native Method)
    at java.base/sun.nio.ch.Net.bind(Net.java:455)
    at java.base/sun.nio.ch.Net.bind(Net.java:447)
    at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
    at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80)
    at jdk.httpserver/sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:101)
    at jdk.httpserver/sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50)
    at jdk.httpserver/sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)
    at jdk.httpserver/com.sun.net.httpserver.HttpServer.create(HttpServer.java:137)
    at io.prometheus.jmx.shaded.io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:176)
    at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:31)
    ... 6 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
Aborted (core dumped)

Any Help regarding this ?

cybacolt commented 3 years ago

what was the resolution here?

ErmiasF commented 3 years ago

@Asturias-sam Can you post the Solution?

Asturias-sam commented 3 years ago

Sorry i missed the earlier message

this is the config i am using : export HIVE_METASTORE_HADOOP_OPTS="$HIVE_METASTORE_HADOOP_OPTS -Djava.net.preferIPv4Stack=true -javaagent:/opt/hive/jmx_prometheus_javaagent-0.13.0.jar=8082:/opt/hive/jmx-exporter-config.yml"

For hive-env.sh