用于OrientDb的JMX文档非常稀疏,其中一些来自OrientDb的过时版本。我目前正在尝试3.0.9
我已经找到了如何打开orientdb-server-config.xml文件中的JMX插件。
我添加了Jolokia jar文件并打开了orientdb-server-config.xml文件中的JMX插件。
在启动时,我收到消息:
2018-10-22 14:18:44:331 INFO JMX plugin installed and active: profilerManaged=true [OJMXPlugin]
我可以运行JVM请求:
$ wget http://localhost:8778/jolokia/read/java.lang:type=Memory/HeapMemoryUsagex -O test.out && cat test.out
"request":{"mbean":"java.lang:type=Memory","attribute":"HeapMemoryUsage","type":"read"},"value":{"init":2147483648,"committed":2147483648,"max":2147483648,"used":13631488},"timestamp":1540238969,"status":200}
我对orientdb JMX请求也尝试这样做:
$ wget http://localhost:8778/jolokia/read/com.orientechnologies.orient.core.storage.cache.local:type=O2QCacheMXBean/usedMemory -O test.out && cat test.out && echo
{"request":{"mbean":"com.orientechnologies.orient.core.storage.cache.local:type=O2QCacheMXBean","attribute":"usedMemory","type":"read"},"stacktrace":"javax.management.InstanceNotFoundException: com.orientechnologies.orient.core.storage.cache.local:type=O2QCacheMXBean\n\tat java.management\/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1083)\n\tat java.management\/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:637)\n\tat java.management\/com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:106)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:37)\n\tat org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:89)\n\tat org.jolokia.backend.MBeanServerExecutorLocal.handleRequest(MBeanServerExecutorLocal.java:109)\n\tat org.jolokia.backend.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:161)\n\tat org.jolokia.backend.LocalRequestDispatcher.dispatchRequest(LocalRequestDispatcher.java:99)\n\tat org.jolokia.backend.BackendManager.callRequestDispatcher(BackendManager.java:428)\n\tat org.jolokia.backend.BackendManager.handleRequest(BackendManager.java:158)\n\tat org.jolokia.http.HttpRequestHandler.executeRequest(HttpRequestHandler.java:197)\n\tat org.jolokia.http.HttpRequestHandler.handleGetRequest(HttpRequestHandler.java:86)\n\tat org.jolokia.jvmagent.handler.JolokiaHttpHandler.executeGetRequest(JolokiaHttpHandler.java:276)\n\tat org.jolokia.jvmagent.handler.JolokiaHttpHandler.doHandle(JolokiaHttpHandler.java:233)\n\tat org.jolokia.jvmagent.handler.JolokiaHttpHandler.handle(JolokiaHttpHandler.java:178)\n\tat jdk.httpserver\/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\n\tat jdk.httpserver\/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)\n\tat jdk.httpserver\/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)\n\tat jdk.httpserver\/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:692)\n\tat jdk.httpserver\/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\n\tat jdk.httpserver\/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:664)\n\tat java.base\/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\/java.lang.Thread.run(Thread.java:834)\n","error_type":"javax.management.InstanceNotFoundException","error":"javax.management.InstanceNotFoundException : com.orientechnologies.orient.core.storage.cache.local:type=O2QCacheMXBean","status":404}
我得到一个错误。我不知道我的请求是否不正确,或者JMX bean文档是否不再有效。
在从JMX和jolokia读取orientdb指标方面,我需要一些帮助。