SlideShare ist ein Scribd-Unternehmen logo
1 von 31
GlassFish v2.1
Clustering & Enterprise Manager


Alexis Moussine-Pouchkine
Didier Burkhalter
Sun Microsystems
                                  1
Some vocabulary
• Cluster – a group a homogenous GlassFish instances
 administered as a whole


• Load-Balancing – a strategy and implementation to
 balance HTTP, IIOP, and other incoming requests.
 Enough to provide service continuity


• High-Availability (HA) – replication of stateful data to
 survive instance crash. All about session continuity
Dynamic Clustering with Project Shoal

• GMS with Project Shoal
    http://shoal.dev.java.net
  >
    Dynamic clusters implemented with JXTA by default
  >
    Ease of use in cluster setup
  >
    Differentiates between a member that leaves the group
  >
    because of failure or for administrative reason
  > Configurable
     >Failure timeout detection
     ># of retries for failed member
     >Heartbeat timeouts
In-Memory Replication

• What?
     HTTP session state
 >
     Stateful EJB session state
 >
     Single Sign-On state
 >
     Container state (timers, …)
 >

• How?
 > Default is In-Memory replication with JXTA for application state
 > Can also use HADB for 99.999% uptime
Clustering in GlassFish v2




             JMX = Java Management Extensions
Memory Replication
Typical cluster topology




                Instance 1   Instance 2




                Instance 3   Instance 4




                Machine 1    Machine 2
Memory Replication
Typical cluster topology         Example: Maximize
                                 Availability on 4 node
                                 cluster on 2 machines




                Instance 1   Instance 2




                Instance 3   Instance 4




                Machine 1    Machine 2
Memory Replication
 Typical failover scenario

• Location transparency
  > fail over request can go to any instance in the cluster
• 2 Cases: Failover request lands on
  > Case 1: instance with replica data:
    ownership taken, processing continues
  > Case 2: instance without replica data
     > instance sends broadcast request
     > instance with replica data transfers data back to requester and deletes
       its copy after an acknowledge
     > JXTA makes this easy (propagation communication channels are
       scoped within the “group” (i.e. the cluster members)
HTTP Session State Failover


                    Servlet                    Servlet
                (HTTP Session)             (HTTP Session)


                   replicas                   replicas

 W    Load         instance 1                 instance 2
     Balancer
 S


                    Servlet                    Servlet
                (HTTP Session)             (HTTP Session)


                   replicas                   replicas

                   instance 4    Cluster      instance 3
HTTP Session State Failover


                       Servlet                    Servlet
                   (HTTP Session)             (HTTP Session)


                      replicas                   replicas

  W      Load         instance 1                 instance 2
        Balancer
  S

 Case 1:
 Instance has          Servlet                    Servlet
 replica data      (HTTP Session)             (HTTP Session)


                      replicas                   replicas

                      instance 4    Cluster      instance 3
HTTP Session State Failover


                         Servlet                    Servlet
                     (HTTP Session)             (HTTP Session)


                        replicas                   replicas

  W      Load           instance 1                 instance 2
        Balancer
  S

 Case 2:
 Instance does not       Servlet                    Servlet
 have replica data   (HTTP Session)             (HTTP Session)


 Broadcast…
                        replicas                   replicas

                        instance 4    Cluster      instance 3
HTTP Session State Failover


                         Servlet                    Servlet
                     (HTTP Session)             (HTTP Session)


                        replicas                   replicas

  W      Load           instance 1                 instance 2
  S     Balancer


 Case 2:
 Instance does not       Servlet                    Servlet
 have replica data   (HTTP Session)             (HTTP Session)


 and ownership
                        replicas                   replicas
 transfer…
                        instance 4    Cluster      instance 3
Cluster Dynamic Shape Change


                         Servlet                    Servlet
                     (HTTP Session)             (HTTP Session)


                        replicas                   replicas

  W        Load         instance 1                 instance 2
  S       Balancer


 Shape Change
 instance1 fails         Servlet                    Servlet
                     (HTTP Session)             (HTTP Session)


                        replicas                   replicas

                        instance 4    Cluster      instance 3
Cluster Dynamic Shape Change


                         Servlet                    Servlet
                     (HTTP Session)             (HTTP Session)
                                      X
                        replicas                   replicas

  W        Load         instance 1                 instance 2
  S       Balancer
                                      X
 Shape Change
 instance1 fails         Servlet                    Servlet
                     (HTTP Session)             (HTTP Session)
 Instance2 and 4
 see the failure

                        replicas                   replicas

                        instance 4    Cluster      instance 3
Cluster Dynamic Shape Change


                              Servlet                                  Servlet
                          (HTTP Session)                           (HTTP Session)


                              replicas                                 replicas

  W        Load               instance 1                              instance 2
  S       Balancer


 Shape Change
 instance1 fails              Servlet                                  Servlet
                          (HTTP Session)                           (HTTP Session)
 Instance2 and 4
 see the failure

 Instance4 selects            replicas                                 replicas
 Instance2 as new
 partner—new                  instance 4           Cluster            instance 3
 connections
 established
                     the reverse happens when an instance joins or re-joins the cluster
Memory Replication Configuration
 Our hope was to say…

• “This page left intentionally blank” ;-)
  > Meaning “zero configuration required”
• We came close to that goal…
Memory Replication Configuration
 Out of the box…

• Create a domain
  > Use the ‘cluster’ profile – defaults for replication are handled
     > Enables GMS—heartbeat enabled
     > persistence-type = quot;replicatedquot;
• Create a cluster and instances
• Deploy your application with availability-
  enabled=true
• That’s it
Memory Replication Configuration
 Making your app distributable

• <distributable/> element
  > Required in web.xml
     > Indicates you believe your application is ready to run in a cluster
• Serializable objects required
  > HTTP Session state
  > EJB technology Stateful Session Bean state
Configuring the availability service
Sun GlassFish Enterprise Server


                             Enterprise Manager



                  Customer
                  Advocate                        eLearning
                                                  Credit




   Customer Focused
                                                        24x7 Support
   Support Team


                             GlassFish
                             Open Source
      Sun VIP
                                                        Patches &
                             Application Server
      Interoperability
                                                        Upgrades
      Support
Enterprise Manager


• SNMP Monitoring

• Performance Advisor

• Performance Monitor
Enterprise Manager

• Requires GlassFish Enterprise v2.1 subscription
• Download via SunSolve (www.sunsolve.com)
      SNMP Monitoring: 140750-01
  >
      Performance Advisor: 140751-01
  >
      Performance Monitor: 140749-01
  >
      GlassFish v3: Available in Update Center soon
  >
• Evaluation bundles in development
Enterprise Manager
SNMP Monitoring

• Leverage existing enterprise management tools
• SNMP v1, v2c adapter
  > JSR 77/J2EE MIB
  > Exposes JMX attributes via SNMP
• Deploys as a war file
• Can monitor instances through DAS or directly
• Configured via GlassFish properties
  asadmin set standalone-instance1.property.snmp-adapter-port=10162 asadmin set
  clustered-instance1.property.snmp-adapter-port=10163 asadmin set clustered-
  instance2.property.snmp-adapter-port=1016
GlassFish SNMP Architecture
Enterprise Manager
Performance Advisor - Tuning




                               25
Enterprise Manager
Performance Advisor - Alerts

• Proactive notification of “events of interest”
       Physical memory alert
   >
       Memory leak alert
   >
       CPU Usage trend alert
   >
       JVM Throughput alert
   >
       GC Pause Time alert
   >
       Log entry alert
   >
• Alert notification methods
   > Written to log file
   > Optionally sent to email address(es)
Enterprise Manager
Performance Advisor - Alerts




                               27
Enterprise Manager
Performance Monitor

• Diagnose and monitor GlassFish and JVM performance
• Rich GUI application
  > VisualVM distribution with integrated GlassFish plugin
• Chart performance over time
• Read-only tooling (vs. admin console)
• Local and (secure) remote monitoring
Enterprise Manager
Performance Monitor

• GlassFish observability
      HTTP Service view
  >
      Web View
  >
      EJB View
  >
      JDBC View
  >
      Web Services View
  >
      Cluster View
  >
      Node Agent View
  >
      Pool monitoring (JDBC, EJB, MDB)
  >
• Heap View
• GC View
Enterprise Manager
Performance Monitor




                      30
Questions ?
alexis.mp@sun.com
http://blogs.sun.com/alexismp
                                31

Weitere ähnliche Inhalte

Was ist angesagt?

Dynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFishDynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFish
IndicThreads
 
Tricks and Tips With NIO Using the Grizzly Framework
Tricks and Tips With NIO Using the Grizzly FrameworkTricks and Tips With NIO Using the Grizzly Framework
Tricks and Tips With NIO Using the Grizzly Framework
elliando dias
 

Was ist angesagt? (20)

OSGi Presentation
OSGi PresentationOSGi Presentation
OSGi Presentation
 
Grizzly 20080925 V2
Grizzly 20080925 V2Grizzly 20080925 V2
Grizzly 20080925 V2
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
Jetty Vs Tomcat
Jetty Vs TomcatJetty Vs Tomcat
Jetty Vs Tomcat
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
OSGi in 5 minutes
OSGi in 5 minutesOSGi in 5 minutes
OSGi in 5 minutes
 
Se lancer dans l'aventure microservices avec Spring Cloud - Julien Roy
Se lancer dans l'aventure microservices avec Spring Cloud - Julien RoySe lancer dans l'aventure microservices avec Spring Cloud - Julien Roy
Se lancer dans l'aventure microservices avec Spring Cloud - Julien Roy
 
Design Patterns para Microsserviços com MicroProfile
 Design Patterns para Microsserviços com MicroProfile Design Patterns para Microsserviços com MicroProfile
Design Patterns para Microsserviços com MicroProfile
 
GlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixGlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox Felix
 
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 Update
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
 
Dynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFishDynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFish
 
Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012
 
OSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishOSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFish
 
Tricks and Tips With NIO Using the Grizzly Framework
Tricks and Tips With NIO Using the Grizzly FrameworkTricks and Tips With NIO Using the Grizzly Framework
Tricks and Tips With NIO Using the Grizzly Framework
 
자바 성능 강의
자바 성능 강의자바 성능 강의
자바 성능 강의
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 

Ähnlich wie GlassFish v2.1

Ähnlich wie GlassFish v2.1 (20)

Introduction to Servlets
Introduction to ServletsIntroduction to Servlets
Introduction to Servlets
 
SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_final
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practice
 
Sql server 2012 ha dr
Sql server 2012 ha drSql server 2012 ha dr
Sql server 2012 ha dr
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_final
 
Jetty Continuation - 이상민
Jetty Continuation - 이상민Jetty Continuation - 이상민
Jetty Continuation - 이상민
 
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
 
Sql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffySql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffy
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
 
Vert.x – The problem of real-time data binding
Vert.x – The problem of real-time data bindingVert.x – The problem of real-time data binding
Vert.x – The problem of real-time data binding
 
Sql server 2012 ha dr nova
Sql server 2012 ha dr novaSql server 2012 ha dr nova
Sql server 2012 ha dr nova
 
Cp7 rpc
Cp7 rpcCp7 rpc
Cp7 rpc
 
Wt unit 3
Wt unit 3 Wt unit 3
Wt unit 3
 
J2EE-assignment
 J2EE-assignment J2EE-assignment
J2EE-assignment
 
Managing an Akka Cluster on Kubernetes
Managing an Akka Cluster on KubernetesManaging an Akka Cluster on Kubernetes
Managing an Akka Cluster on Kubernetes
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Java ppt
Java pptJava ppt
Java ppt
 
Galera cluster for MySQL - Introduction Slides
Galera cluster for MySQL - Introduction SlidesGalera cluster for MySQL - Introduction Slides
Galera cluster for MySQL - Introduction Slides
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 

Mehr von Alexis Moussine-Pouchkine

GlassFish Community and future larochelle
GlassFish Community and future larochelleGlassFish Community and future larochelle
GlassFish Community and future larochelle
Alexis Moussine-Pouchkine
 
Retour d'expĂŠrience Cap Gemini GlassFish
Retour d'expĂŠrience Cap Gemini GlassFishRetour d'expĂŠrience Cap Gemini GlassFish
Retour d'expĂŠrience Cap Gemini GlassFish
Alexis Moussine-Pouchkine
 

Mehr von Alexis Moussine-Pouchkine (20)

GlassFish Article September 07
GlassFish Article September 07GlassFish Article September 07
GlassFish Article September 07
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
GlassFish Community and future larochelle
GlassFish Community and future larochelleGlassFish Community and future larochelle
GlassFish Community and future larochelle
 
Javaee glassfish jcertif2010
Javaee glassfish jcertif2010Javaee glassfish jcertif2010
Javaee glassfish jcertif2010
 
GlassFish Community - FISL 2010
GlassFish Community - FISL 2010GlassFish Community - FISL 2010
GlassFish Community - FISL 2010
 
GlassFish OSGi - From modular runtime to hybrid applications
GlassFish OSGi - From modular runtime to hybrid applicationsGlassFish OSGi - From modular runtime to hybrid applications
GlassFish OSGi - From modular runtime to hybrid applications
 
Feuille de route (roadmap) GlassFish
Feuille de route (roadmap) GlassFishFeuille de route (roadmap) GlassFish
Feuille de route (roadmap) GlassFish
 
Java EE 6 Solutions Linux 2010
Java EE 6 Solutions Linux 2010Java EE 6 Solutions Linux 2010
Java EE 6 Solutions Linux 2010
 
L'association GUSES
L'association GUSESL'association GUSES
L'association GUSES
 
Open Solaris 2009.06
Open Solaris 2009.06Open Solaris 2009.06
Open Solaris 2009.06
 
Java EE 6 and GlassFish portfolio
Java EE 6 and GlassFish portfolioJava EE 6 and GlassFish portfolio
Java EE 6 and GlassFish portfolio
 
Metro Web Services
Metro Web ServicesMetro Web Services
Metro Web Services
 
Retour JavaOne 2009
Retour JavaOne 2009Retour JavaOne 2009
Retour JavaOne 2009
 
Zembly
ZemblyZembly
Zembly
 
Behind The Clouds
Behind The CloudsBehind The Clouds
Behind The Clouds
 
Retour d'expĂŠrience Cap Gemini GlassFish
Retour d'expĂŠrience Cap Gemini GlassFishRetour d'expĂŠrience Cap Gemini GlassFish
Retour d'expĂŠrience Cap Gemini GlassFish
 
OpenDS - Open Source Java LDAP server
OpenDS - Open Source Java LDAP serverOpenDS - Open Source Java LDAP server
OpenDS - Open Source Java LDAP server
 
Open MQ Jerome Moliere
Open MQ Jerome MoliereOpen MQ Jerome Moliere
Open MQ Jerome Moliere
 
OpenMQ François Ostyn
OpenMQ François OstynOpenMQ François Ostyn
OpenMQ François Ostyn
 
OpenSSO Microsoft Interop
OpenSSO Microsoft InteropOpenSSO Microsoft Interop
OpenSSO Microsoft Interop
 

KĂźrzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

KĂźrzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

GlassFish v2.1

  • 1. GlassFish v2.1 Clustering & Enterprise Manager Alexis Moussine-Pouchkine Didier Burkhalter Sun Microsystems 1
  • 2. Some vocabulary • Cluster – a group a homogenous GlassFish instances administered as a whole • Load-Balancing – a strategy and implementation to balance HTTP, IIOP, and other incoming requests. Enough to provide service continuity • High-Availability (HA) – replication of stateful data to survive instance crash. All about session continuity
  • 3. Dynamic Clustering with Project Shoal • GMS with Project Shoal http://shoal.dev.java.net > Dynamic clusters implemented with JXTA by default > Ease of use in cluster setup > Differentiates between a member that leaves the group > because of failure or for administrative reason > Configurable >Failure timeout detection ># of retries for failed member >Heartbeat timeouts
  • 4. In-Memory Replication • What? HTTP session state > Stateful EJB session state > Single Sign-On state > Container state (timers, …) > • How? > Default is In-Memory replication with JXTA for application state > Can also use HADB for 99.999% uptime
  • 5. Clustering in GlassFish v2 JMX = Java Management Extensions
  • 6. Memory Replication Typical cluster topology Instance 1 Instance 2 Instance 3 Instance 4 Machine 1 Machine 2
  • 7. Memory Replication Typical cluster topology Example: Maximize Availability on 4 node cluster on 2 machines Instance 1 Instance 2 Instance 3 Instance 4 Machine 1 Machine 2
  • 8. Memory Replication Typical failover scenario • Location transparency > fail over request can go to any instance in the cluster • 2 Cases: Failover request lands on > Case 1: instance with replica data: ownership taken, processing continues > Case 2: instance without replica data > instance sends broadcast request > instance with replica data transfers data back to requester and deletes its copy after an acknowledge > JXTA makes this easy (propagation communication channels are scoped within the “group” (i.e. the cluster members)
  • 9. HTTP Session State Failover Servlet Servlet (HTTP Session) (HTTP Session) replicas replicas W Load instance 1 instance 2 Balancer S Servlet Servlet (HTTP Session) (HTTP Session) replicas replicas instance 4 Cluster instance 3
  • 10. HTTP Session State Failover Servlet Servlet (HTTP Session) (HTTP Session) replicas replicas W Load instance 1 instance 2 Balancer S Case 1: Instance has Servlet Servlet replica data (HTTP Session) (HTTP Session) replicas replicas instance 4 Cluster instance 3
  • 11. HTTP Session State Failover Servlet Servlet (HTTP Session) (HTTP Session) replicas replicas W Load instance 1 instance 2 Balancer S Case 2: Instance does not Servlet Servlet have replica data (HTTP Session) (HTTP Session) Broadcast… replicas replicas instance 4 Cluster instance 3
  • 12. HTTP Session State Failover Servlet Servlet (HTTP Session) (HTTP Session) replicas replicas W Load instance 1 instance 2 S Balancer Case 2: Instance does not Servlet Servlet have replica data (HTTP Session) (HTTP Session) and ownership replicas replicas transfer… instance 4 Cluster instance 3
  • 13. Cluster Dynamic Shape Change Servlet Servlet (HTTP Session) (HTTP Session) replicas replicas W Load instance 1 instance 2 S Balancer Shape Change instance1 fails Servlet Servlet (HTTP Session) (HTTP Session) replicas replicas instance 4 Cluster instance 3
  • 14. Cluster Dynamic Shape Change Servlet Servlet (HTTP Session) (HTTP Session) X replicas replicas W Load instance 1 instance 2 S Balancer X Shape Change instance1 fails Servlet Servlet (HTTP Session) (HTTP Session) Instance2 and 4 see the failure replicas replicas instance 4 Cluster instance 3
  • 15. Cluster Dynamic Shape Change Servlet Servlet (HTTP Session) (HTTP Session) replicas replicas W Load instance 1 instance 2 S Balancer Shape Change instance1 fails Servlet Servlet (HTTP Session) (HTTP Session) Instance2 and 4 see the failure Instance4 selects replicas replicas Instance2 as new partner—new instance 4 Cluster instance 3 connections established the reverse happens when an instance joins or re-joins the cluster
  • 16. Memory Replication Configuration Our hope was to say… • “This page left intentionally blank” ;-) > Meaning “zero configuration required” • We came close to that goal…
  • 17. Memory Replication Configuration Out of the box… • Create a domain > Use the ‘cluster’ profile – defaults for replication are handled > Enables GMS—heartbeat enabled > persistence-type = quot;replicatedquot; • Create a cluster and instances • Deploy your application with availability- enabled=true • That’s it
  • 18. Memory Replication Configuration Making your app distributable • <distributable/> element > Required in web.xml > Indicates you believe your application is ready to run in a cluster • Serializable objects required > HTTP Session state > EJB technology Stateful Session Bean state
  • 20. Sun GlassFish Enterprise Server Enterprise Manager Customer Advocate eLearning Credit Customer Focused 24x7 Support Support Team GlassFish Open Source Sun VIP Patches & Application Server Interoperability Upgrades Support
  • 21. Enterprise Manager • SNMP Monitoring • Performance Advisor • Performance Monitor
  • 22. Enterprise Manager • Requires GlassFish Enterprise v2.1 subscription • Download via SunSolve (www.sunsolve.com) SNMP Monitoring: 140750-01 > Performance Advisor: 140751-01 > Performance Monitor: 140749-01 > GlassFish v3: Available in Update Center soon > • Evaluation bundles in development
  • 23. Enterprise Manager SNMP Monitoring • Leverage existing enterprise management tools • SNMP v1, v2c adapter > JSR 77/J2EE MIB > Exposes JMX attributes via SNMP • Deploys as a war file • Can monitor instances through DAS or directly • Configured via GlassFish properties asadmin set standalone-instance1.property.snmp-adapter-port=10162 asadmin set clustered-instance1.property.snmp-adapter-port=10163 asadmin set clustered- instance2.property.snmp-adapter-port=1016
  • 26. Enterprise Manager Performance Advisor - Alerts • Proactive notification of “events of interest” Physical memory alert > Memory leak alert > CPU Usage trend alert > JVM Throughput alert > GC Pause Time alert > Log entry alert > • Alert notification methods > Written to log file > Optionally sent to email address(es)
  • 28. Enterprise Manager Performance Monitor • Diagnose and monitor GlassFish and JVM performance • Rich GUI application > VisualVM distribution with integrated GlassFish plugin • Chart performance over time • Read-only tooling (vs. admin console) • Local and (secure) remote monitoring
  • 29. Enterprise Manager Performance Monitor • GlassFish observability HTTP Service view > Web View > EJB View > JDBC View > Web Services View > Cluster View > Node Agent View > Pool monitoring (JDBC, EJB, MDB) > • Heap View • GC View