coherence managed coherence servers - part 1 - overview
DESCRIPTION
Watch on YouTube: http://www.youtube.com/watch?v=312NXTTzdAgTRANSCRIPT
Managed Coherence Servers – WebLogic SeverPart 1 – Introduction and use-cases
Tim Middleton - Solutions Architect – Oracle Coherence Development
<Insert Picture Here>
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2
• Managed Coherence Servers Overview• Architecture & Deployment Models• Demonstration
Agenda
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3
WebLogic Server – Terminology
• Domain - group of instances and clusters under unified control
• Administration Server - central configuration controller for the domain
• Managed Server - Instance that hosts applications and required resources
• Cluster - group of managed servers to provide increased scalability and reliability
• Node Manager - per-machine process used to start, stop and auto-restart instances
Node Manager
Machine
Managed Server
Managed Server
Node Manager
Machine
Managed Server
Managed Server
Cluster
Node Manager
Machine
Managed Server
Managed Server
Node Manager
Machine
Administration Server
Domain
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4
• Traditional Deployment & Management Approach– Coherence applications have traditionally been deployed as a jar incorporated
into a Java application such as a WAR/EAR or standalone Java application– Typically there are usually two roles within a Coherence application:
• Servers – hold cache data and performs server processing• Clients – do not hold data but perform data operations
– Servers are usually started by Running a Java class (DefaultCacheServer) using scripts specifying an array of JVM arguments to configure an instance
• Challenges with this approach– The lifecycle of these artifacts are usually managed separately by custom shell
scripts/utilities and not by WebLogic Server– This can make the development, deployment and management of these type of
applications more difficult – No “standard” way to deploy/manage Coherence across different platforms and
environments– Every customer has no option but to re-invent the wheel
Traditional Deployment Approach
<caching-scheme-mapping> <cache-mapping> <cache-name>dist-*</cache-name> <scheme-name>example-distributed</scheme-name> <init-params> <init-param> <param-name>back-size-limit</param-name> <param-value>8MB</param-value> </init-param> </init-params> </cache-mapping>
<cache-mapping> <cache-name>near-*</cache-name> <scheme-name>example-near</scheme-name> <init-params> <init-param> <param-name>back-size-limit</param-name> <param-value>8MB</param-value> </init-param> </init-params> </cache-mapping>
<cache-mapping> <cache-name>repl-*</cache-name> <scheme-name>example-replicated</scheme-name> </cache-mapping>
<cache-mapping> <cache-name>opt-*</cache-name>
<coherence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config" xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-operational-config coherence-operational-config.xsd" xml-override="/tangosol-coherence-override.xml">
<cluster-config> <multicast-listener> <time-to-live system-property="tangosol.coherence.ttl">4</time-to-live> <join-timeout-milliseconds>3000</join-timeout-milliseconds> </multicast-listener> </cluster-config>
<logging-config> <severity-level system-property="tangosol.coherence.log.level">5</severity-level> <character-limit system-property="tangosol.coherence.log.limit">0</character-limit> </logging-config></coherence>
EARShell
scripts
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5
• Provides a tight integration between WebLogic Server and Coherence
– This results in a simplified and streamlined development, deployment and management environment for Coherence applications
• Introduces the Grid Archive (GAR) – Follows the Java EE model– Consolidates configuration into a single distributable entity– Provides Application Isolation & Lifecycle Events
• Leverages WebLogic infrastructure – Management & Deployment carried out through standard
WebLogic tools such as Configuration Wizard, WebLogic admin console, WLST, JMX and FMWC
– Node Manager for lifecycle management
• Coherence remains available “standalone” including support for GARs
Managed Coherence Servers - Introduction
Cluster
Standalone Coherence Clusters
Coherence Server
Coherence Server
MachineMachine
WebLogic Domain/Coherence Managed Servers
Machine
Node Manager
Admin Server
Node ManagerNode Manager
ClusterJava EE/Coh
ServerJava EE/Coh
Server
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6
• Simplified Operations Management– Configure, manage and deploy Coherence using standard WebLogic
tooling such as Administration console, WLST and Config Wizard – Manage Coherence resources centrally– Tight Maven integration– Ability to carry out rolling Restarts across a WebLogic cluster– Separates Operational Config from Cache Config
• Simplified development and deployment– GAR manages all application build artifacts– Simplified application deployment across entire data grid– Based on industry standard Java EE– Automatic application isolation– OEPE tooling available
• Easier integration for WebLogic Server-based applications that leverage Coherence
Managed Coherence Servers - Benefits
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7
Create a Coherence Application (GAR)- Package GAR as separate artifact
- GAR can also be packaged in WebLogic EAR or as a shared library
- Include config files coherence-application.xml, coherence-cache-config.xml, pof-config.xml
Establish Coherence Infrastructure- Coherence cluster general attributes – cluster port, name, etc
- Tiered topology (Application layer and Storage layer) via WLS Clusters
- Leverage Configuration Wizard, Console, WLST, FMWC
Deploy GAR into Coherence Infrastructure- Console, WLST, FMWC, webLogic.Deployer, ant
- Coherence services will be automatically started
Monitor Deployment and Cluster Infrastructure
Managed Coherence Servers - Usage
MachineMachine
WebLogic Domain/Coherence Managed Servers
Machine
Node Manager
Admin Server
Node ManagerNode Manager
Cluster
CoherenceApp
CoherenceApp
Managed Server
Managed Server
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8
• Managed Coherence Servers Overview• Architecture & Deployment Models• Demonstration
Agenda
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9
• A GAR file contains Coherence and dependent artifacts required for the operation of a Coherence application
• The structure of a GAR is as follows:
What is a Grid Archive (GAR)?
META-INF/MAINFEST.MF /coherence-application.xml /coherence-cache-config.xml /pof-config.xml
com/oracle/demo/Class1.class /Class2.class....
lib/myjar.jar /myjar2.jar
GAR Deployment descriptor file
Cache configuration file
POF configuration file (optional)
Classes required by the Coherenceapplication such as entry processors,POJO’s, aggregators, business logic.
Any supporting libraries (optional)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10
Pointer to POF configuration file
• The GAR deployment descriptor, coherence-application.xml contains the following:
What is a Grid Archive (GAR)?
<?xml version="1.0" encoding="ISO-8859-1"?><coherence-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/weblogic/coherence-application"> <cache-configuration-ref override-property="cache-config/ExamplesGar">META-INF/example-cache-config.xml </cache-configuration-ref> <pof-configuration-ref>META-INF/pof-config.xml</pof-configuration-ref>
<application-lifecycle-listener> <class-name>com.tangosol.examples.container.gar.LifecycleReactor</class-name> </application-lifecycle-listener> <configurable-cache-factory-config /></coherence-application>
Pointer to cache configuration file, with optional override property
Optional implementation of LifeCycleListener for pre/post start processing
Optional implementation of ConfigurableCacheFactory
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11
• GAR modules can be deployed to a Managed Server in number of ways to support Coherence based applications
GAR Deployment Modes
MyApp2.gar
Stand Alone – cachesare automatically isolated
Application.ear
MyApp.gar
MyApp1.gar WebApp.war
MyApp.gar
Embedded GAR - available to war/jar files in EAR
Deployed as shared library –available to all WAR/EAR
WebEJB.jar
Application.ear
WebApp.war
WebEJB.jar
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12
• Best practice is to have a storage-disabled client tier
• We can utilize the WebLogic clustering capabilities to set this in Coherence
• Example deployment example:– DataTier cluster is storage-enabled – WebTier cluster is storage-disabled– MyApp.gar deployed to DataTier
cluster– MyWebApp.ear deployed to
WebCluster
Example Deployment ArchitectureDomain
WebLogic Cluster: DataTier (storage-enabled)
WebLogic Cluster: WebTier (storage-disabled)
MS1 MS2 MS3
MyApp.gar MyApp.gar MyApp.gar
MS4
MyApp.ear
MyApp.gar
WebAp.war
MS5
MyApp.ear
MyApp.gar
WebAp.war
MS6
MyApp.ear
MyApp.gar
WebAp.war
WebLogic Cluster
Coherence Cluster
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13
• Managed Coherence Servers Overview• Architecture & Deployment Models• Demonstration
Agenda
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14
Walk-through creation of Managed Coherence Servers using the WebLogic Server Admin Console
Demonstration
WebLogic Server Domain (base_domain)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15