Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Operations and Monitoring with Spring

on

  • 2,237 views

Operations and Monitoring with Spring

Operations and Monitoring with Spring

Statistics

Views

Total Views
2,237
Views on SlideShare
2,232
Embed Views
5

Actions

Likes
3
Downloads
60
Comments
0

1 Embed 5

http://servidor1.i2e.es 5

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Operations and Monitoring with Spring Presentation Transcript

  • 1. Operations and Monitoring with Spring Eberhard Wolff Regional Director and Principal Consultant SpringSource Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 2. A Short History of Spring •  Spring is a platform independent framework for the development of (Enterprise) Java Applications •  Originally started as an easier to use alternative for Java EE development •  In particular compared to EJB •  See "J2EE Development Without EJB" •  But actually there is more to it Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 2
  • 3. Programming Model vs. Infrastructure •  Programming Model: A set of APIs to use as a developer •  Infrastructure: Something to run your software on •  Spring defines a Programming Model but no Infrastructure •  …you can use Java EE, a simple Servlet container… •  Java EE defines a Programming Model and an Infrastructure Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 3
  • 4. Bundling Programming Model and Infrastructure •  Bundling leads to some problems •  To upgrade the programming model you need to upgrade the infrastructure •  Operations will not like that idea •  You are limited to a certain infrastructure – what do you do concerning OSGi? •  You only get the benefit from OSGi if you use its non OSGi deployment model •  Users realize how flexible they are using Spring Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 4
  • 5. Spring s Impact on Java EE Production Environment Production Environment Production Environment WAR WAR WAR EAR Spring Spring EJB Powered Powered Application Application Jaav EE Application Server Spring Spring Servlet Container Java EE Application Server Tomcat EJB Container Servlet Container Servlet Container • Connection mgmt. • Connection mgmt. • Connection mgmt. • Clustering • Clustering • Clustering • Deployment management • Deployment management • Deployment management Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 5
  • 6. So: What is the advantage of Spring over Java EE 6? •  Type error: Cannot compare infrastructure + programming model to programming model •  But seriously… •  Spring actually exists – Java EE 6 is still being standardized •  You don't need to upgrade your server (many are still on Java EE 5) •  Actually this question is not important to many: They don't run on Java EE anyway Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 6
  • 7. Today s De Facto Standards Spring and Tomcat WebLogic 26% Spring Applications JBoss 38% WebSphere 43% Apache Tomcat 68% 0% 10% 20% 30% 40% 50% 60% 70% Java Application Server Usage, Source: 2008 Evans Data Survey •  Obviously the Java EE platform is often not needed •  A Servlet container is enough •  …and too complex Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 7
  • 8. Is Spring + Servlet container as powerful as Java EE? •  "Classic" features of a Java EE server Feature Spring Solution Transactions No real 2PC but smart solutions for many scenarios Security Spring Security is much better Distribution Not too important any more Spring Remoting offers even more features Persistence Java EE's persistence (JPA) can be used – and several other Naming Supported by Dependency Injection Connection / Resource Supported by Servlet Containers and Pooling DataSource implementations Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 8
  • 9. So… •  Let's add transaction support (JTA) to Tomcat •  Then we have a full blown Application Server •  But Tomcat is very successful already •  …and Spring offers solutions –  for O/R mappers –  for JMS + a DataSource •  JTA seems to be a not too important •  Is there anything else we need to think about? •  Infrastructure is not just for developers! Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 9
  • 10. Operations •  Operations cares about –  monitoring –  administration •  They should be able to look into application •  Usually there is more than one Application Server – how can you handle larger installations? •  Individual updates of parts of an application are important •  Virtualization / Cloud Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 10
  • 11. Spring Enterprise - Looking into Applications Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 12. Spring Enterprise - Looking into Applications •  Certified Spring •  Instrumented Spring Your Application –  Monitor Spring apps across infrastructure •  JMX flows into Management Application Management –  Track app Enterprise Application performance •  Just different JMX JARs •  No code changes Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 12
  • 13. Demo: Spring Enterprise Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 14. Handling large clusters Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 15. Cluster •  Usually there is more than one Tomcat server in an installation •  How can you manage them? •  Ideally centralized Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 15
  • 16. SpringSource tc Server Tomcat you know. Enterprise capabilities you need. tc Server Tomcat Enterprise Capabilities Enterprise Distributed Diagnostics support Operations Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 16
  • 17. Product Architecture tc Server machine 1 Mgmt tc Server Hyperic Server Agent Hyperic Hyperic Server Web Configs Console Inventory, Metric, Audit, … Scripts tc Server machine n Other Manageable Items tc Apache http Server Hyperic Agent Apache Tomcat Server ActiveMQ JVM Configs Operating Systems Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 17
  • 18. tc Server •  Binaries almost unchanged – no lock in •  Centralized monitoring and administration •  Groups of server allow to deal with a group of servers – not just one –  Start / stop / restart –  Deployment –  Configuration including JVM options •  Easy operations of large Tomcat installations Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 18
  • 19. Demo: tc Server Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 20. Demo WhiteRabbit Ubuntu1 tc Hyperic Server Agent Hyperic Hyperic Server Web Console Inventory, Metric, Audit, … Ubuntu1 tc Hyperic Server Agent Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 20
  • 21. Updating parts of an application Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 22. dm Server •  Modularization is key to maintainable software •  Modularization at runtime gives more power to Operations •  Updates of parts of the application •  Determining the source of an error •  etc •  On the client and in the embedded world OSGi has succeeded as a standard for modularization •  OSGi enters the server market… Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 22
  • 23. OSGi Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 24. It's a module system •  Partition a system into a number of modules – "bundles" •  Dynamic: Bundles can be installed, started, stopped, uninstalled and updated •  ...at runtime •  better operations •  Strict visibility rules •  Resolution process satisfies dependencies of a module •  Understands versioning Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 24
  • 25. It's even service-oriented •  Bundles can publish services… dynamically! •  Service Registry allows other bundles to consume services •  Services come and go at runtime –  … transparently when using Spring-DM Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 25
  • 26. OSGi Bundle •  The fundamental unit of deployment and modularity in OSGi •  Just a JAR file –  with additional entries in META-INF/MANIFEST.MF •  Common manifest headers: –  Bundle-SymbolicName –  Bundle-Version –  Bundle-Name –  Bundle-ManifestVersion –  Bundle-Vendor Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 26
  • 27. Import / Export -Package Declares package-level dependencies of your bundle. Import-Package: com.xyz.foo; >= 1.0.3; e.g., Import-Package: 1.0.3.GA, 1.0.4, com.xyz.foo;version="1.0.3" etc. Import-Package: com.xyz.foo;version="[1.0.3,1.0.3]" Import-Package: com.xyz.foo;version="[1.0.3,1.1.0)", com.xyz.bar;version="[1.0.3,2.0.0)" Export-Package: com.xyz.foo Export-Package: com.xyz.foo;version="1.0.5" Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 27
  • 28. Spring Dynamic Modules & SpringSource dm Server Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 29. Spring-DM: ApplicationContext •  Configuration files in /META-INF/spring •  Automatically merged •  ..and ApplicationContext is created Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 29
  • 30. Service export and import <beans ...> <osgi:service ref="customerDAO" interface="dao.ICustomerDAO" /> <osgi:reference id="dataSource" interface="javax.sql.DataSource" /> </beans> Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 30
  • 31. Service export and import •  Dynamic services automatically dealt with •  i.e. method calls are buffered •  Purely declarative •  No dependencies on OSGi in the code •  No resource leaks •  Not solved in Spring Dynamic Modules: –  Easy import of libraries –  Using JPA or Hibernate in OSGi –  Seamless Web Support –  Notion of an application •  Enter dm Server Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 31
  • 32. dm Server Platform • Modular profiles WAR Web Module Bundle Personality Personality Personality • Bundle repository • Library provisioning • Serviceability Tomcat Deployer Management – FFDC – Logging / Tracing • Built on Equinox Dynamic Modules Kernel • Modular architecture – Subsystems Equinox – Bundles • Small footprint JVM Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 32
  • 33. Bundles for the example •  Web Web •  Service •  API: only interfaces and domain classes API –  Implementation can be exchanged •  Could add infrastructure: Service DataSource / PlatformTransactionManager Package Import Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 33
  • 34. Bundles & Types •  Only dependencies to the API •  Therefore: implementation can be exchanged even at runtime •  No direct dependencies to any implementation •  Not shown: dependencies to external bundles •  … can be installed in dm Server •  … modular middleware! Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 34
  • 35. Bundles & Services web Service Registry Services: api Publish / Consume service Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 35
  • 36. Bundles & Services •  Infrastructure can use the same principle as application services •  i.e. DataSource and PlatformTransactionManager are just another service •  Can I still run on plain Java EE? •  Yes: instead of OSGi Service directly inject Spring Beans •  no more more dynamic services / modularization •  No code change needed •  Application can run on Java EE or OSGi Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 36
  • 37. PAR •  Packaging format for all modules in an application Taglibs Web •  JAR with Application-* manifest headers Spring API •  Single unit: deploy, refresh, undeploy •  Application boundaries Service –  Scoping of types and services Application –  DataSource does not leak out of the application Package –  Hibernate can change Import domain objects Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 37
  • 38. Web Migration: From WAR to PAR Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 39. Web Application Deployment Options •  Standard Java EE WAR services –  supported on dm Server as is Standard WAR –  converted into an OSGi libs bundle •  Shared Libraries WAR –  WAR + OSGi package imports services Bundle –  Eradicate library bloat of Shared Libraries WAR Repository monolithic Java EE –  WARs •  Shared Services WAR Shared Services WAR –  Uses OSGi services OSGi with Spring's Service <osgi:reference> Registry •  Web Module Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 39
  • 40. Roadmap Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 41. dm Server 2.0 Roadmap •  SpringSource dm Server 2.0: 2009 •  Cloning bundles –  solves problems around static variables and more •  Shared Repository –  make a repository available to other servers •  Plan Files –  Define an application as a collection of bundles –  Does not contain the bundles, more flexible •  Distributed and improved Management –  operation on a group of servers –  like tc Server for Tomcat •  Modular Web Applications Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 41
  • 42. Support for Enterprise OSGi Standards •  RFC 66: Web Container for OSGi (RI based on dm Server) •  RFC 119: Distributed OSGi •  RFC 124: Blueprint Service (RI based on Spring- DM) •  RFC 139: JMX interface for OSGi •  RFC 142: JNDI and OSGi integration Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 42
  • 43. Note: OSGi has an impact on operations •  New deployment model •  Updates of bundles possible •  How much less regression testing do you actually do? •  Is redeploying just a part of an application OK for operations? Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 43
  • 44. Virtualization / Cloud •  Deployment blueprints define machines and their characteristics •  vApp define a deployment format based on such blueprints •  dm Server, tc Server etc will be configurable using vApp properties (e.g. ports) •  vApps can be pre defined – just add your application •  vApps can optimize for network traffic or availability •  Deployment and set up of the VMs is trivial •  …in your private or a public cloud Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 44
  • 45. Summary Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 46. Summary •  Spring is a portable programming model •  This help the move from full blown Java EE to Servlet containers •  An important part of infrastructures is support for operations •  Issues: –  Monitoring e.g. Spring Enterprise –  Cluster e.g. tc Server –  Modularization at runtime e.g. OSGi / dm Server –  Virtualization / Cloud Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 46
  • 47. Questions? Eberhard Wolff eberhard.wolff@springsource.com http://SpringSource.com Build   Run   Manage   Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.