1
Oracle WebLogic Devcast Series: JMX for DevOpsDr. Frank MunzOracle Technologist of the Year, Cloud
ORACLE
PRODUCT
LOGO
g ,
2
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. I i i d li i l d f i li d h ldIt is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracleʼs products remains at the sole discretion of Oracle.
Who is this guy?
• Frank Munz• Founded munz & more in 2007• 12+ years WebLogic Server and
Oracle Fusion Middleware• Consulting and High End Training• Consulting and High-End Training• NEW book:
“WebLogic 12c: Advanced Recipes”
3
WebLogic 12c: JMX For DevOps
• Download NetBeans projects andadditional links at the end
• “JMX for DevOps” ?
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #5
Agenda
1. Basics2. Tools / Clients3. Programming4. Wrap-upp p
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #6
4
JMX BASICSJMX BASICS
JMX
• Java Management Extensions (JSR-003)J g (J )+ JMX Remote API (JSR-160)• Supported from Java 5• JMX 1.2 supported since WLS 9.xJ pp• WebLogic 12c: RESTful access
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #8
5
MBeans
MBeans have attributes, operations, use notifications
W bL i MB l tWebLogic MBeans encapsulate– Configuration Data– Runtime Values
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #9
MBean ServersOracle WebLogic JVMJMX
JVM Platform MBean Server
Edit MBean Server
JSR 160 RMI Connector
Edit MBean Server
Runtime MBean Server
DomainRuntime MBean Server
RESTful
MBean
Admin
RMI Client JVM
htt
Frank Munz / www.munzandmore.com / Oracle DevCast
ConnectorMBean MBean
Admin
http
6
MBean Object Name
domainPart:listOfPropertiesdomainPart:listOfProperties
com.bea used for Name=…,Type=…WebLogic MBeans [,ParentType1=Parent1Name]
[ ParentType2=Parent2Name] [ ][,ParentType2=Parent2Name] [,…][,Location=serverName]
Example: com.bea:Name=AdminServer,Type=Server
Frank Munz / www.munzandmore.com / Oracle DevCast
JMX TOOLS / CLIENTSAdmin console, JConsole, WLST, RESTful Management Services, Jolokia.
JMX TOOLS / CLIENTS
9
Open Source JMX Shell, RESTful API, Monitoring Plugins
WebLogic 12c Admin Console
• Comfortable and feature-rich graphical JMX clientg p J• All changes from console are done via JMX• Sometimes scripting is preferred-> WLST scripts can be recordedp
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #18
10
DEMODEMOAdmin ConsoleAdmin Console
WebLogic Scripting Tool (WLST)
• Efficient and versatile. It can replace:p Configuration wizard Template builder Command line deployment: weblogic.Deployerp y g p y Admin console
• Online / offline modeFrank Munz / www.munzandmore.com / Oracle DevCast Slide #20
11
WLST
MW_HOME/wlserver_12.1/common/bincontains start script for WLST: wlst.sh
Or run command-line with WL_HOME set and weblogic jar in classpath:weblogic.jar in classpath:
java weblogic.WLST [Script.py]Frank Munz / www.munzandmore.com / Oracle DevCast Slide #21
DEMODEMOWLSTWLST
12
WLST Quick Referencels() ls('a') shows attributes , 'c' child MBeans, 'o' operations cd() navigation
domainConfig() change to domain configuration treeserverConfig() change to server config MBeansdomainRuntime() change to domain runtime treeserverRuntime() change to server runtime MBeans custom() change to custom treejndi() change to JNDI tree
edit() change to writable edit treestartEdit() start an edit session, then use set('attribute','value') save() persist changesactivate() / undo() activate / undo changes
configToScript() export domain configuration to WLST scriptfind() find attributeseaseSyntax() switch off python syntax (do not use for scripting!)
WebLogic 12cRESTful Management Service• Enable from admin console• Retrieves cluster, server, deployment and JDBC
http://host:port/management/tenant-monitoring/servers?format=full
• Built-in AJAX client for testing: http://host:port/management/ajaxtest.html
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #24
13
DEMOORESTful Management
S iService
Jolokia
• HTTP/JSON bridge for remote JMX accessJ g J• -> Avoids JVM overhead on client side• Uses j4p.war or JVM agent on WebLogic• Supports many JEE servers• j4psh JMX shell with tab-completion and
syntax highlighting• Understanding of MBean names required
Frank Munz / www.munzandmore.com / Oracle DevCast
17
WebLogic 12c Advanced Recipes
http://www amazon comhttp://www.amazon.com/dp/0980798019/
Available Jan 1, 2013
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #33
Links
DevOps
http://radar.oreilly.com/2012/06/what-is-devops.html
Oracle WebLogic 12c JMX Documentation
http://docs.oracle.com/cd/E24329_01/web.1211/e24416/toc.htm
RESTful Management Services
http://www.oracle.com/technetwork/articles/soa/oliveira-wls-rest-javafx-1723982.html
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #34
18
Links
Spring Reference, Chapter 22, JMXhtt // t ti i / i /d /3 0 0 RELEASE/ fhttp://static.springsource.org/spring/docs/3.0.0.RELEASE/reference/html/jmx.html#jmx-exporting
Oracle JMX Tutorialhttp://docs.oracle.com/javase/tutorial/jmx/mbeans/standard.html
Oracle MXBeans explained:http://docs.oracle.com/javase/6/docs/api/javax/management/MXBean.html
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #35
Links
Jolokia Web Site:
http://jolokia.org
munz & more http://www.munzandmore.com/blog
http://www.munzandmore.com/newsletter
Frank Munz / www.munzandmore.com / Oracle DevCast Slide #36
19
Let’s connect
Frank Munz / www.munzandmore.com / Oracle DevCast
Join the WebLogic Community
Twittertwitter.com/oracleweblogic
Facebookfacebook.com/oracleweblogic
Oracle’s WebLogic blogblogs.oracle.com/weblogicserver
Youtube
Youtube.com/oracleweblogic
Oracle.com/technetwork/weblogic