Jolokia - JMX on Capsaicin (Devoxx 2011)

36,193 views

Published on

"Jolokia - JMX on Capsaicin" was given as a "Tools in Action" talks at Devoxx 2011. For the full presentation, please go to parleys.com which includes a full recording of the talk.

Published in: Technology, Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
36,193
On SlideShare
0
From Embeds
0
Number of Embeds
32,178
Actions
Shares
0
Downloads
37
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Jolokia - JMX on Capsaicin (Devoxx 2011)

  1. 1. Jolokia - JMX on CapsaicinRoland HußChili-HeadConSol* Software GmbH
  2. 2. Me and the Chili• Development and Operations @ ConSol – Large Java Projects – Remote Operations – Open Source Monitoring (Nagios) – www.consol.com• Open Source Author – roland@cpan.org – https://github.com/rhuss• Chili grower since 2005 2
  3. 3. JMX JSR-3 JSR-160The Problem
  4. 4. JMX Refresher• Java Management Extensions (JMX)• JSR-3 (2000)• Available out of the box since JDK 1.5• JMX-Operations: – Attribute reading – Attribute writing – Execution of operations – Notifications 4
  5. 5. JMX Architecture 5
  6. 6. JMX Remote API• JSR-160 (2003)• Problems: – Firewalls – Security is typically „all-or-nothing“ – Strongly typed – Java only 6
  7. 7. Jolokia Overview Features Clients Tools
  8. 8. How it works 8
  9. 9. Agents JEE OSGi Mule JVM 9
  10. 10. Tested on ...Tomcat 5.5, 6.0, 7.0 Felix 2.0, 3.2, 4.0 3.5, 3.6,Jetty 5.1, 6.1, 7.5, 8.0 Equinox 3.7, 3.8 M1 9.2.3, 10.0.2,Weblogic 10.3.5 Knopflerfish 3.2Websphere 6.1, 7.0, 8.0 Virgo 2.1, 3.0Glassfish 2.1, 3.0, 3.1 Spring dm Server 2.0JBoss 4.2, 5.1, 6.1, 7.0 Mule 2.2, 3.1, 3.2Jonas 4.10, 5.1, 5.2 ActiveMQ 5.5Geronimo 2.1, 2.2, 3.0 M1 Terracotta 3.2Camel 2.8 Hadoop 0.20 10
  11. 11. Quickstart 11
  12. 12. Request• HTTP GEThttp://localhost/jolokia/read/java.lang:type=Memory/HeapMemoryUsage• HTTP POST { "type":"read", "mbean":"java.lang:type=Memory", "attribute":"HeapMemoryUsage" } 12
  13. 13. Response{ "value": { "init": 134217728, "max": 532742144, "committed": 133365760, "used": 19046472 }, "status": 200, "timestamp": 1244839118, "request": { "mbean": "java.lang:type=Memory", "type": "read", "attribute": "HeapMemoryUsage" } } 13
  14. 14. Request Typesversion Version and server informationread Reading of attributeswrite Writing of attributesexec Execution of operationssearch Pattern search for MBeanslist MBean meta data 14
  15. 15. Bulk Requests [ { "type" : "read", "mbean" : "java.lang:type=Memory", "attribute" : "HeapMemoryUsage", "path" : "used", }, { "type" : "search", "mbean" : "*:type=Memory,*" } ] 15
  16. 16. JSR-160 Proxy 16
  17. 17. Proxy Request{ "attribute" : "HeapMemoryUsage", "mbean" : "java.lang:type=Memory", "target": { "url" : "service:jmx:iiop://websphere:2810/jndi/JMXConnector" "user" : "roland", "password" : "s!cr!t" }, "type" : "READ"} 17
  18. 18. Security• JSR-160 Security – Java Security and JAAS• Jolokia Security – HTTP Security – Access Control with Policy Files • Network location • Command types • MBean, attribute and operation names 18
  19. 19. ClientsPerl Jmx4PerlJavascript JolokiaJava JolokiaPython Jmx4Py Jürgen HerrmannNode.js jolokia-client Joachim KainzGroovyScala You ?..... 19
  20. 20. Javascript Demo 20
  21. 21. Javascriptvar j4p = new Jolokia("/jolokia");var data = [];function run() { j4p.request({ type: "read", mbean: "java.lang:type=Memory", attribute: "HeapMemoryUsage" }, { success: function(resp) { data.push([resp.timestamp,resp.value.used]); $.plot($("#memory"),[data],{ xaxis: { mode: "time" }}); setTimeout(run,1000); } });}run(); 21
  22. 22. Tools jmx4perl CLI Tool check_jmx4perl Nagios Plugin cacti_jmx4perl Cacti Plugin j4psh JMX Shell AccessJ iPhone Client Roo Addon Spring Roo Addon 22
  23. 23. j4psh 23
  24. 24. Wrap up• JMX is good• JSR-160 connectors are bad• Jolokia ... ... is a JSON-HTTP adaptor to JMX ... has unique features ... allows for non-Java clients ... has good tool support 24
  25. 25. Resources• www.jolokia.org • Reference-Manual: http://www.jolokia.org/reference/html/ • Forum: http://www.jolokia.org/forum.html• Blog • ConSol Labs: http://labs.consol.de• Github • https://github.com/rhuss/jolokia• T-Shirts ;-) • http://jolokia.spreadshirt.de• Twitter: @jolokia_jmx 25
  26. 26. Questions ?

×