Java TM Management Extensions (JMX TM ) Adam Quan.

Slides:



Advertisements
Similar presentations
Managing Components with JMX Rickard Öberg JBoss.
Advertisements

J2EE Architecture Overview
The road to reliable, autonomous distributed systems
An architecture for webb applications, J2EE
6/4/2015Page 1 Enterprise Service Bus (ESB) B. Ramamurthy.
ManageEngine TM Applications Manager 8 Monitoring Custom Applications.
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
JAVA Technology. Java Technology Java technology is a portfolio of products that are based on the power of networks and the idea that the same software.
Enterprise Applications & Java/J2EE Technologies Dr. Douglas C. Schmidt Professor of EECS.
1. Introducing Java Computing  What is Java Computing?  Why Java Computing?  Enterprise Java Computing  Java and Internet Web Server.
JSLEE. What is JSLEE ? is an event oriented application middleware. Its main job is to receive events from external resources and deliver these events.
Network Management with JMX Thu Nguyen Oliver Argente CS158B.
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Nikolaos Korfiatis The Java 2 Enterprise Edition Platform Dept. of Management & Technology-Athens University of Economics and Business Java 2 Platform.
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
© DSRG 2001www.cs.agh.edu.pl Cross Grid Workshop - Kraków Krzysztof Zieliński, Sławomir Zieliński University of Mining and Metallurgy {kz,
© 2004 IBM Corporation BEA WebLogic Server Introduction and Training.
Understanding and Managing WebSphere V5
® IBM Software Group © IBM Corporation IBM Information Server Service Oriented Architecture WebSphere Information Services Director (WISD)
31 January 2007Craig E. Ward1 Large-Scale Simulation Experimentation and Analysis Database Programming Using Java.
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
Course # 3250 Best Practices and Design Patterns for JMX Development Satadip Dutta Justin Murray Hewlett-Packard.
JRun 4 & Macromedia MX Tommy Reilly JRun Engineer.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
Original work by David Moran JMX Update Scott Molenaar 11/08/2004.
December 3-6, 2007, Santa Clara Marriott, Santa Clara, CA Wiseman: enabling JMX applications via WS-Management JSR-262(Web Services Connector): JMX apps.
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
Entity Java Beans Jorg Janke Open Source ERP & CRM.
Enterprise Java Beans Part I Kyungmin Cho 2001/04/10.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java v120131Intro to JavaEE1 Java EE 5 TM Introduction.
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
Mike Dickson Tidal Software
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Management J2EE & JOnAS Domain Management JOnAS Juin 2005
Client Call Back Client Call Back is useful for multiple clients to keep up to date about changes on the server Example: One auction server and several.
Databases JDBC (Java Database Connectivity) –Thin clients – servlet,JavaServer Pages (JSP) –Thick clients – RMI to remote databases –most recommended way.
Web Services Presented By : Noam Ben Haim. Agenda Introduction What is a web service Basic Architecture Extended Architecture WS Stacks.
Configuring & Managing Web Services for Joachim Flammer Integration Team EGEE is a project funded by the European Union under contract IST
Java Management Extensions (JMX) Jmx Introduction.
Jini Architecture Introduction System Overview An Example.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
JMX David Moran 10/20/03. Agenda Overview Managed Beans Services Remote API J2EE Management Implementations Future Directions Demo.
Jorke Odolphi Product Technology Specialist WebCentral Using Microsoft Operations Manager To Monitor And Maintain Your Farm.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Enterprise Computing with Jini Technology Mark Stang and Stephen Whinston Jan / Feb 2001, IT Pro presented by Alex Kotchnev.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Alan L. Batongbacal CS 4244 / 01 Nov 2000
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED INTERSTAGE BPM ARCHITECTURE BPMS.
The Holmes Platform and Applications
Netscape Application Server
Open Source distributed document DB for an enterprise
Introduction to J2EE Architecture
Java EE Overview The problem Java Enterprise Edition attempts to solve: maximize the use of Java technologies by providing a suite of Java technology specifications.
Managing Components with JMX
Mike Dickson Tidal Software
Web-Services-based Systems Architecture, Design and Implementation
Enterprise Service Bus (ESB) (Chapter 9)
Java EE Overview The problem Java Enterprise Edition attempts to solve: maximize the use of Java technologies by providing a suite of Java technology specifications.
Web Application Server 2001/3/27 Kang, Seungwoo. Web Application Server A class of middleware Speeding application development Strategic platform for.
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Presentation transcript:

Java TM Management Extensions (JMX TM ) Adam Quan

2 Agenda JMX Technology Updates JMX Architecture (JSR 3) MBeans MBean server JMX security JMX Remoting (JSR 160) JMX and J2SE (JSR 77) JMX and J2EE (JSR 174) Real-World JMX Applications A Simple Demo

3 Why Management & Monitoring? Infrastructure Software is Getting More Complicated Administration Configuration Monitoring Enterprise Business Application Characteristics: Distributed Complex Mission Critical High-Volume Dynamic

4 An Analogy First

5 What is JMX? Defines the Architecture, Design Patterns, APIs and the Services for exposing and managing applications and network devices. Provides a means to: Instrument Java code. Implement distributed management middleware and managers. Smoothly integrate these solutions into existing management systems. From Opaque Applications to Transparent Processes

6 JMX Benefits Low Cost Scalable Management Architecture – Modularization of agent services Easy Integration – JMX smart agents manageable through various protocols Dynamic Management Integrates Existing Management Solutions Leverages Existing Standard Java Technologies Applicable to a Wide Range of Applications Possible Automatic Instrumentation

7 Typical JMX Usage Reading and Changing Application Configurations Infrastructure and Business Level Operational Statistics Availability Early Detection of Capacity Problems Application Performance, Business Process Productivity Resources usage Problems Signaling events Faults State changes Improving Services via Proactive Alerting

8 Management Before JMX Firewall Failover Hardware Web Server Application Server Database Primary Servers Web Server Application Server Database Secondary Servers Web Server Management Console App Server Management Console Web Server Management Console App Server Management Console Database Management Console Failover Management Console Database Management Console Firewall Management Console

9 Management With JMX Firewall Failover Hardware Web Server Application Server Database Primary Servers Web Server Application Server Database Secondary Servers MBean Server Instrumentation Layer Management Application Console Connector/ Adaptor

10 JMX Architecture Management Applications Managed Resources Instrumentation MBeans JMX Instrumentation JMX Distributed Services JMX Agent Services Protocol and InfoModel independent Source: JavaSoft

11 What Is an MBean? A Java object that implements a specific interface and conforms to certain design patterns. The management interface specifies: Attributes (fields) which may be accessed Operations (methods) which may be invoked Notifications (events) which may be emitted Constructors of the MBean‘s Java class

12 MBean Types Four Types of MBeans: Standard MBean - Simple, Static Dynamic MBean - Flexible, Dynamic Open MBean - Basic Data Types Only Model MBean - Run Time Support Differ in Implementations, Not the Way They Are Managed

13 Standard MBean For static management information. Follows naming conventions. The MBean server constructs the MBeanInfo for standard MBeans via reflection. Constructors – Any public constructors Attributes – getters/setters Operations – Any remaining public methods Notification

14 Standard MBean Example – The Management Interface public interface PrinterMBean { public int getPrintJobCount(); public String getPrinterName(); public int getPrintQuality(); public void setPrintQuality(int q); public void cancelPrintJobs(); public void performSelfCheck(); }

15 Standard MBean Example – The MBean Implementation public class Printer extends NotificationBroadcasterSupport implements PrinterMBean { private int printJobCount; private String printerName; private int printQuality; … public void performSelfCheck(){ … if ( error ) { sendNotification(notification); }

16 Dynamic MBean Supports management information that is known only at runtime Implements DynamicMBean interface Responsible for building its own MBeanInfo structure Generic methods expose: Attributes Operations For changing resources

17 Dynamic MBean: Generic Method Access Dynamic MBean Protocol Adaptor Instrumentation Layer Agent LayerDistribution Layer Management Application getAttribute setAttribute getAttributes setAttributes invoke(…) Managed Resource Version 1 Managed Resource Version 2 getMBeanInfo()

18 Open MBean Why are Open MBeans “Open”? Dynamic MBeans that use a subset of universal Java types Descriptively rich metadata “Open” to widest range of management applications Does Not Require Serialization – supports management applications not written in Java No Custom Classloading Required in 1.2

19 Model MBean Generic, Configurable Dynamic MBean Common Template for Different MBeans Configured at Runtime: Descriptors Default Implementation – RequiredModelMBean Rapid Instrumentation – No need to write an MBean Model MBean Features Persistence – survive JMX agent crash Notification Logging Attribute Value Caching – better performance Operation Delegation – multiple manageable resources

20 Model MBean Example ObjectName oName = new ObjectName(…); createMBean(“javax.management.modelmbe an.RequiredModelMBean”, oName ); Object managedResource = …; setManagedResource(…); ModelMBeanInfo info = buildModelMBeanInfo( mbeanDesc ); setModelMBeanInfo(…); 1 2 3

21 JMX Notification Notification – Java objects emitted by MBeans and the MBean server to encapsulate events, alerts, or general information. Based on the Java event model Specifies notification objects, the broadcaster, the listener and filter interfaces that notification senders and receivers must implement. Management applications listen to the MBean and MBean server notifications remotely.

22 Object Name Uniquely identifies MBean Two parts domain name key/value property list (unordered) [domainName]:name=value[,name=value]* ObjectName class

23 JMX Agent Layer JMX Agent – A Java process that provides a set of services for managing a set of MBeans. The container for an MBean server. JMX Agent Level MBean Server(s) Agent Services Four Mandatory Standard Services (MBeans) M-Let Service Timer Service Monitoring Service Relation Service

24 MBean Server A registry for MBeans – MBeans have to be registered. Exposes management interfaces: Creates MBeans Registers MBean Handles notifications – add/remove listeners. Handles access to MBeans – get/set attributes, invoke operations. Handles MBean queries – based on object names and attributes. MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer(“HelloAgent“);

25 Standard Agent Services: M-Let Service Expand JMX agent CODEBASE. Dynamically load new components to the MBean server. Allows network-enabled application to load its MBean components from remote hosts. Enables hot deployment.

26 Standard Agent Services: Timer Service Schedule notifications for tasks that need to be run once or at regular intervals. Specific Times Intervals More elegant solution than background threads in a J2EE environment.

27 Standard Agent Services: Monitoring Service Common Monitor Management Interface Attributes ObservedObject ObservedAttribute GranularityPeriod Active MonitorNotification Three monitor implementations Counter monitor: threshold Gauge monitor: high/low threshold String monitor: matches /differs

28 Standard Agent Services: Relation Service Define relations between MBean components and react to changes in case of MBean dependencies. Consistency Cardinality Conceptually relate MBeans Allows to manage MBeans as related groups Typically grouped based on managed resources or workflows they participate in.

29 Distributed Services Level Connectors Contains connector client and connector server Hide the actual protocol being used to contact the agent. Can use any convenient transport – RMI, RMI/IIOP, HTTP, SOAP, JMS, JINI, “Raw” TCP/UDP, … Protocol Adaptors Listen for incoming messages that are constructed in a particular protocol like HTTP, SNMP JMX Remoting API (JSR-160) – The Standardization

30 JMX Remote API (JSR 160) Allows Any Java Client To: Discover JMX Connectors Connect to Any Running JMX Server Access to a Running JMX Server via a Protocol- Independent Client API JMX Remoting API Goals Interoperable – Completely defines standard protocols Transparent – Remote access like local Secure – Built on JSSE, JAAS, SASL Flexible – New transport protocols can be added easily

31 JMX Remoting Connectors RMI Connector – Required JMXMP Connector – Based on Java serialization over TCP Generic Connector – Configurable by plugging in modules to define Transport Protocol and Object Wrapping Connector Server Address service:jmx:rmi://host/… service:jmx:jmxmp://host:port

32 JMX Remoting Example: Remote Access Like Local Local Access: MBeanServer mbs = MBeanServerFactory.createMBeanServer(); mbs.createMBean( className, obName ); Object a = mbs.getAttribute( obName, “attr” ); Set names = mbs.queryNames(…); Remote Access: JMXConnector c = JMCConnectorFactory.connect(url); MBeanServerConnection mbs = c.getMBeanServerConnection(); mbs.createMBean( className, obName ); Object a = mbs.getAttribute( obName, “attr” ); Set names = mbs.queryNames(…); c.close();

33 JMX Security JMX Security Risks: MBeanServer API Access MBean API Access Trusted MBean Sources JMX Security introduced in JMX 1.2 Based on Standard Java Security Model by defining Permissions ( javax.security.Permission) MBeanServerPermission MBeanPermission MBeanTrustPermission Why not J2EE Role-base Security Model?

34 MBean Permission Example grant applone.jar { permission javax.management.MBeanServerPermission “createMBeanServer, releaseMBeanServer”; }; grant applone.jar { permission javax.management.MBeanPermission “com.Foo#doIt[d1]”, “invoke”; }; grant signedBy “MyOrg” { permission javax.management.MBeanTrustPermission “register”;};

35 JMX and J2SE JMX is going into J2SE 1.5 JSR 174 – Monitoring and Management Specification for Java Health Indicators: Class load/unload Memory allocation statistics Garbage collection statistics Monitor info & statistics Thread info & statistics Object info … Runtime Control: Heap size Verbose GC on demand Garbage collection control Thread creation control Just-in-time compilation control …

36 JMX and J2EE: J2EE Management (JSR 77) JMX is Going into J2EE 1.4 Further J2EE Standardization: Vendor Independent Management of J2EE Servers Defines a Model of J2EE Managed Objects No Java Classes Managed EJB (MEJB) Management Capability: Event Handling – state/attribute change, creation/destruction State Management – manage an object’s state Performance Monitoring – statistics data

37 J2EE Managed Objects

38 Managed EJB (MEJB) Context ctx = new InitialContext(); ManagementHome home = (ManagementHome)PortableRemoteObject.narrow( ctx.lookup(“ejb/mgmt/MEJB”), ManagementHome.class); Management mejb = home.create(); String domain = mejb.getDefaultDomain(); Set names = mejb.queryNames( new ObjectName(domain+”:j2eeType=EJBModule,*”),null); Iterator itr = names.iterator(); while( itr.hasNext() ) { ObjectName name = (ObjectName)itr.next(); ObjectNames[] ejbs = (ObjectName[])mejb.getAttribute(name, “ejbs”); } All EJB Modules All EJBs in a Module 1 2 3

39 JMX In Use Today All Major Application Servers BEA WebLogic IBM WebSphere JBoss Management Applications Tivoli Web Component Manager AdventNet Middleware Manager Dirig Softare Performance Management Tools Existing instrumentation Custom instrumentation

40 JMX Use Case: WebLogic Administration and Configuration MBeans Runtime MBeans – information about open servlet sessions, active JDBC connections, JTS transactions, pooled EJBs, JMS messages Anything deployed into WebLogic is automatically manageable EJBComponentRuntime EJBHomeRuntime EJBRuntime EJBTransactionRuntime 1 … n 1 … 1

41 Real-World JMX Usage Log4j Runtime Control JDBC Connection Pool Management HTTP Session Management Generic Cache Control Cache Size Cache Policy Cache Hit Rate Cache Refresh

42 Real-World JMX Usage (cont.) Socket Adaptor for Integration Monitoring Tool to Collect Data Key Application Transaction Monitoring Pluggable Security Providers Timer Queue Management Custom Queue JMS Queue …

43 Summary JMX technology is a standard, mature and complete open solution to manage and monitor both Java applications and underlying infrastructure. Developers should have application management and monitoring in mind during design phase, not as an after-thought. Developer’s main task will be writing interfaces and reporting tools that make use of the instrumentation already provided by Application Servers.

44 A Simple Demo: Log4j Control Log4j Logger LoggerController MBean HTTP Adaptor JRMP Adaptor MBean Server Web Browser MC4J Console

45 A Simple Demo: Log4j Control (cont.) public interface LoggerControllerMBean { public String getLevel(String loggerName); public void setLevel(String loggerName,String level); } public class LoggerController implements LoggerControllerMBean{ public String getLevel(String loggerName) { Logger logger = Logger.getLogger(loggerName); return logger.getLevel().toString(); } public void setLevel(String loggerName, String level) { Level level = Level.toLevel(level); Logger.getLogger(loggerName).setLevel(level); }

46 References JMX in Action Benjamin G. Sullins, Mark Whipple Publisher: Manning Publications Company Benjamin G. SullinsMark Whipple JMX: Managing J2EE with Java Management Extensions Marc Fleury, Juha Lindfors Marc FleuryJuha Lindfors Publisher: Sams Java and JMX: Building Manageable Systems Heather Kreger, Ward K. Harold, Leigh Williamson, Ward Harold Publisher: Pearson Education Heather KregerWard K. HaroldLeigh WilliamsonWard Harold Sun JMX Page: AdventNet: MC4J: MX4J: