SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
GLASSFISH V2
CLUSTERING AND
LOAD BALANCING
Satyajit Tripathi
ISV-Engineering, Sun Microsystems


                                    1
GlassFish V2 UR2
Open for Business – Deploy and Redistribute for free
• Latest release in August 2008 (Download). 3-Months cycle
• Production Quality. First Application Server with Java EE 5
• Code base as Sun Java System Application Server 9.1 U2
• Platform Of Choice: Solaris, MS Windows, Linux, MacOS, AIX
• Open Source. OSI License CDDL or GPL-v2, with CPE
• Advanced features supported
  >   Clustering (HA and Scalability). In-Memory Replication (new feature!)
  >   Centralized Administration and Monitoring – CLI and GUI based
  >   Web Service Interoperability and JBI (JSR 208) compliant runtime
  >   Improved Self Management capabilities & best-in-class Performance
• Attractive Support Pricing subscription based
                                                                          2
GlassFish V2 Clusters
Centralized Administration, High Availability, Scalability
• GlassFish V2 supports three different Administration profiles
   > Developer :     No clustering features or NSS keystore
   > Cluster    :    Clustering features without HADB and NSS keystore
   > Enterprise :    HADB or Network Security Services (NSS)
• Setup different profiles using setup.xml or setup-cluster.xml
  command ${glassfish.home}/lib/ant/bin/ant -f setup-cluster.xml
• Profile attribute AS_ADMIN_PROFILE in the file
  ${glassfish.home}/config/asadminenv.conf
• Enhanced Cluster capabilities
   > Memory Replication or HADB (99.999%)
   > Dynamic Java Clustering (Project Shoal)

                                                                         3
GlassFish Cluster Administration
asadmin>
           1




           5


           3
           4

           2
                                   4
Cluster Components
Architecture
•   Domain Administration Server (DAS)
•   Node Agent
•   Cluster
•   Server Instance
•   Application
•   Group Management Service (GMS)




                                         5
Domain Administration Architecture
Centralized Administration




                                     6
Domain Administration Server
Based on Java Management Extensions (JMX) Technology
• At runtime the process manages itself, server instances, clusters,
  applications, and resources. Comprise of set of configuration files.
• Domain Administration Server (DAS) must run on a physical host
• DAS maintains Central Server Repository Cache
• Delegates management of server instances to the Node Agent
• By itself can serve as a fully compliant Java EE server
• Command tool asadmin>
  > create-domain [--adminport][--profile][--domaindir] <domain-name>
  > start-domain <domain-name>
  > list-domains [--host][--port][--user][--password]
• JMX (JSR3 and JSR160) compliant Managed Bean (MBean)
  supports dynamic resource and configuration instrumentation            7
Node Agent
Manages Server Instances on Hosting system
• Controls the life cycle of server instance(s) on the host
• Need to run on every physical host running server instance(s)
• Delegated by the DAS to manage the server instances
• Maintains local Instance Repository Cache
• Synchronizes Instances with Central DAS Repository Cache
• Command tool asadmin> (default master password: changeit)
  > create-node-agent <node-agent-name>
  > start-node-agent [--syncinstances=true|false] <node-agent-name>
  > list-node-agents
• Monitors (“watchdog”) the server instance(s) and notifies DAS
                                                                      8
Cluster
High Availability (HA) and Session Replication
• A logical entity, binds multiple homogeneous server instances
• Performs fail over between server instances transparent to LB
• Heartbeat should be Enabled (GMS described later)
• Command tool asadmin>
  > create-cluster [--host][--port] <cluster-name>
  > start-cluster <cluster-name>        (*Starts all Server Instances)
  > list-clusters
• HA and Session Replication can be achieved either through
  > Memory Replication OR
  > HADB
• JXTATM technology for inter process communication
                                                                         9
Server Instance
Java EE 5 Compliant Application Server
• Server instance must run on a physical host and requires a JVM
• Runs as Java EE server process and hosts Java EE application
• Instances within the cluster have homogeneous configuration
• Command tool asadmin>
  > create-instance [--host][--port][--cluster][--nodeagent] <instance-name>
  > start-instance <instance-name>          (*Node agent must be running)
  > list-instances
• Server Instances listen through
  >   HTTP : Listener Port and SSL_Listener Port
  >   IIOP : Listener Port, SSL_Listener Port and SSL_MutualAuth Port
  >   JMS Provider Port
  >   JMX System_Connector Port                                           10
Group Management Service
Enable for Dynamic Clustering and In-Memory Replication
• GMS provides dynamic membership information about cluster
  and its member instances
• Provides Notification event model for runtime shape change
  events in the cluster and Management Rules
• Core is based on open source JXTATM (Juxtapose) technology
• Provides Service Provider Interface (SPI) for plug-able group
  communication with cluster(s)
• GMS in GlassFish Application Server monitors cluster health
• GMS provides support to memory replication modules


                                                                  11
Application
Configuring for High Availability
• Web modules to be marked as <distributable /> in web.xml
• Should support replication of session state, e.g. Http session,
  Stateful session bean, and Single sign-on object(s)
• Should implement Serializable interface for session replication
• Group Management Service (GMS) should be enabled
• Configure Availability of individual application or EJB module
  asadmin> deploy --target <cluster-name> --availabilityenabled=true <application>
• Availability of EJB Container asadmin>
   > set availability-service.ejb-container-availability.availability-enabled=”true”
   > set availability-service.ejb-container-availability.sfsb-persistence-type=”file”
   > set availability-service.ejb-container-availability.ha-persistence-type=”ha”
• Individual Bean in file sun-ejb-jar.xml add <ejb availability-enabled=”true”>         12
Availability Service
domain.xml




                       13
Memory Replication
High Availability Techniques
• Available with GlassFish V2 Cluster or Enterprise profile
• JXTA technology used can handle high volume and throughput
• Module uses Grizzly NIO for high I/O performance
• GMS should be enabled
• Properties in domain.xml to be set as
     persistence-type=replicated
     persistence-frequency=web-method | time-based
     persistence-scope=session | modified-session | modified-attribute
• Replication relies on version of HTTP-Session, container
  managed cookies JSESSIONID and JSESSIONIDVERSION

                                                                         14
HADB
High Availability Techniques
• HADB software is supplied with SJS AS 9.1 distribution
• HADB available only in the Enterprise profile and with IPv4 Ipv6
• Network should be configured as UDP multicast
• Command tool asadmin> create-cluster
  [--host][--port][--hosts][--haagentport][--haadminpassword] <cluster-name>
• Command tool asadmin> configure-ha-cluster
  [--host][--port][--haagentport][--haadminpassword][--autohadb] <cluster-name>
• Command tool asadmin> configure-ha-persistence
  [--host][--port][--scope][--store=<jndi>][--type=memory|file|ha] <cluster-name>
• In domain.xml override Session-Manager specific sub properties
  manager-properties, store-properties, session-properties
                                                                                    15
Clustering Considerations
Pros and Cons
• Provides options for High Availability and Scalability, but has
  performance overheads
• HADB is highly reliable, but has relatively higher cost, than
  Memory Replication, for Implementation and Maintenance
• Memory replication is faster, but needs proper Capacity
  Planning to Session failover considerations
• Application modifications may be required to make Session
  objects Serializable to enable replication across multiple JVM
• Multi-tier distributed application architecture may require
  special considerations and configurations
• Currently clustering is possible only within single Sub-net
                                                                    16
Load Balancer
Architectural Choices
• Software Load Balancer
  > Sun HTTP LB plug-in* (on SJS Web Server, Apache, Microsoft IIS)
  > Apache mod_jk (How to setup)
• Hardware Load Balancer
  > Sun Secure Application Switch (General info)
  > F5 BIG-IP v4.5 application traffic management device (How to setup)
• Dynamic Load Balancing
  > MBean monitors or change specific attributes using GlassFish Self
    Management JMX (JSR 3 and JSR 160), and
  > AMX, Application server Management eXtension, APIs (JSR 77) to
    change Application Server configurations

                                                                          17
Sun HTTP LB Plugin
Features
• Sticky RR Load Balancing
• Support for multiple clusters
• Rapid HTTP request failover (< 30 ms)
• Configurable Health checking to re-enlist server
• Check and reload the dynamic LB configuration changes
• Support for Quiescence, enables rolling web service upgrade
• Auto-retry of failed requests for idempotent URL
• Configurable Error pages


                                                                18
Load Balancer Configuration
Install LB Plugin
• Install a supported Web server on respective OS (matrix)
• Installation of LB Plugin
  >   Create a directory lbplugin under ${glassfish.home}/lib
  >   Download the Sun HTTP LB Plugin jar file (aslb-9.1)
  >   Unjar the file in the directory ${glassfish.home}/lib/lbplugin
  >   Unzip the files SUNWaslb.zip and SUNWaspx.zip
  >   Ensure permission 755 to directory ${glassfish.home}/lib/lbplugin/lib
• Administration Console to setup Load Balancer
  >   Create Load Balancer node and select Automatically Apply Changes
  >   Select Targets either as Cluster or Standalone instances
  >   Enable Cluster for load balancing
  >   Enable Application for load balancing and failover
                                                                              19
Load Balancer Configuration
Administration Console




                              20
Load Balancer Configuration
Setup LB Plugin
• Generate Load Balancer configuration loadbalancer.xml
    >   asadmin create-http-lb-config --target cluster1 lb-config
    >   asadmin enable-http-lb-server cluster1
    >   asadmin enable-http-lb-application --name clusterjsp cluster1
    >   asadmin export-http-lb-config --config lb-config loadbalancer.xml
    OR a single command
    > asadmin configure-http-lb-config --target lb-config loadbalancer.xml
•   Copy libpassthrough.so to ${ws.home}/plugins/lbplugin/bin/.
•   Copy ./errorpages to ${ws.home}/plugins/lbplugin/errorpages/.
•   Copy *.res to ${ws.home}/plugins/lbplugin/resource/.
•   Copy loadbalancer.xml to${ws.instance}/config/.
•   Copy sun-loadbalancer_1_2.dtd ${ws.instance}/config/.                    21
Load Balancer Configuration
loadbalancer.xml
• Generate Load Balancer configuration loadbalancer.xml
  <!DOCTYPE loadbalancer PUBLIC quot;-//Sun Microsystems Inc.//DTD Sun One Application Server
      8.1//ENquot; quot;sun-loadbalancer_1_2.dtdquot;>
  <loadbalancer>
      <cluster name=quot;cluster1quot; policy=quot;round-robinquot;>
            <instance name=quot;instance1quot; enabled=quot;truequot; disable-timeout-in-minutes=quot;60quot;
                 listeners=quot;http://host:port1quot; weight=quot;100quot;/>
            <instance name=quot;instance2quot; enabled=quot;truequot; disable-timeout-in-minutes=quot;60quot;
                 listeners=quot;http://host:port2 weight=quot;100quot;/>
            <web-module context-root=quot;clusterjspquot; enabled=quot;truequot; disable-timeout-in-minutes=quot;60quot;
                 error-url=quot;sun-http-lberror.htmlquot; />
            <health-checker url=quot;/quot; interval-in-seconds=quot;10quot; timeout-in-seconds=quot;30quot; />
      </cluster>
      <property name=quot;reload-poll-interval-in-secondsquot; value=quot;60quot;/>
      <property name=quot;response-timeout-in-secondsquot; value=quot;30quot;/>
      <property name=quot;https-routingquot; value=quot;truequot;/>
      <property name=quot;require-monitor-dataquot; value=quot;truequot;/>
      <property name=quot;active-healthcheck-enabledquot; value=quot;falsequot;/>
      <property name=quot;number-healthcheck-retriesquot; value=quot;3quot;/>
      <property name=quot;rewrite-locationquot; value=quot;truequot;/>
  </loadbalancer>
                                                                                                   22
Load Balancer Configuration
Web Server Configuration
• Modify ${ws.instance}/config/magnus.conf
  ##BEGIN EE LB Plugin Parameters
     Init fn=quot;load-modulesquot; shlib=quot;${ws.home}/plugins/lbplugin/bin/libpassthrough.soquot;
     funcs=quot;init-passthrough,service-passthrough,name-trans-passthroughquot; Thread=quot;noquot;
     Init fn=quot;init-passthroughquot;
  ##END EE LB Plugin Parameters

• Modify ${ws.instance}/config/obj.conf
  NameTrans fn=quot;name-trans-passthroughquot; name=quot;lbpluginquot; config-file=
    quot;${ws.instance}/config/loadbalancer.xmlquot;
  And
  <Object name=quot;lbpluginquot;>
         ObjectType fn=quot;force-typequot; type=quot;magnus-internal/lbpluginquot;
         PathCheck fn=quot;deny-existencequot; path=quot;*/WEB-INF/*quot;
         Service type=quot;magnus-internal/lbpluginquot; fn=quot;service-passthroughquot;
         Error reason=quot;Bad Gatewayquot; fn=quot;send-errorquot; uri=quot;$docroot/badgateway.htmlquot;
  </Object>

                                                                                        23
GlassFish V2 Resources
• GlassFish V2 Cluster : Developer Technical Article
• Training and Certification On Java EE technologies
• GlassFish Project : http://glassfish.dev.java.net
  > Download: previews, current and past releases, plug-ins
  > Learning: documentation, tutorials, technical articles, flash demos
  > Community Aquarium: latest news, forums, events, mailing lists
• GlassFish Wiki : http://wiki.glassfish.java.net
• Bug list : Priority P1 and P2
• Users Alias : <users@glassfish.dev.java.net>


                                                                          24
GLASSFISH V2
CLUSTERING AND
LOAD BALANCING
Satyajit Tripathi
http://blogs.sun.com/stripathi


                                 25

Más contenido relacionado

La actualidad más candente

PGEncryption_Tutorial
PGEncryption_TutorialPGEncryption_Tutorial
PGEncryption_Tutorial
Vibhor Kumar
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
Derek Downey
 
Dynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFishDynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFish
IndicThreads
 
HMS: Scalable Configuration Management System for Hadoop
HMS: Scalable Configuration Management System for HadoopHMS: Scalable Configuration Management System for Hadoop
HMS: Scalable Configuration Management System for Hadoop
DataWorks Summit
 

La actualidad más candente (20)

Using advanced options in MariaDB Connector/J
Using advanced options in MariaDB Connector/JUsing advanced options in MariaDB Connector/J
Using advanced options in MariaDB Connector/J
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
 
J boss
J bossJ boss
J boss
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with Memcached
 
PGEncryption_Tutorial
PGEncryption_TutorialPGEncryption_Tutorial
PGEncryption_Tutorial
 
WildFly BOF and V9 update @ Devoxx 2014
WildFly BOF and V9 update @ Devoxx 2014WildFly BOF and V9 update @ Devoxx 2014
WildFly BOF and V9 update @ Devoxx 2014
 
Building better Node.js applications on MariaDB
Building better Node.js applications on MariaDBBuilding better Node.js applications on MariaDB
Building better Node.js applications on MariaDB
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
 
MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery Planning
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
Connection Pooling in PostgreSQL using pgbouncer
Connection Pooling in PostgreSQL using pgbouncer Connection Pooling in PostgreSQL using pgbouncer
Connection Pooling in PostgreSQL using pgbouncer
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
 
03 h base-2-installation_andshell
03 h base-2-installation_andshell03 h base-2-installation_andshell
03 h base-2-installation_andshell
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data Grid
 
JBOSS ONLINE TRAINING
JBOSS ONLINE TRAININGJBOSS ONLINE TRAINING
JBOSS ONLINE TRAINING
 
WildFly & WildFly Swarm
WildFly & WildFly SwarmWildFly & WildFly Swarm
WildFly & WildFly Swarm
 
Hadoop Cluster Management
Hadoop Cluster ManagementHadoop Cluster Management
Hadoop Cluster Management
 
Dynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFishDynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFish
 
MaxScale - The Pluggable Router
MaxScale - The Pluggable RouterMaxScale - The Pluggable Router
MaxScale - The Pluggable Router
 
HMS: Scalable Configuration Management System for Hadoop
HMS: Scalable Configuration Management System for HadoopHMS: Scalable Configuration Management System for Hadoop
HMS: Scalable Configuration Management System for Hadoop
 

Destacado

Client Server Architecture
Client Server ArchitectureClient Server Architecture
Client Server Architecture
suks_87
 

Destacado (13)

Glassfish An Introduction
Glassfish An IntroductionGlassfish An Introduction
Glassfish An Introduction
 
GlassFish in Production Environments
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production Environments
 
Large Scale Data Clustering: an overview
Large Scale Data Clustering: an overviewLarge Scale Data Clustering: an overview
Large Scale Data Clustering: an overview
 
Glassfish JEE Server Administration - Clustering
Glassfish JEE Server Administration - ClusteringGlassfish JEE Server Administration - Clustering
Glassfish JEE Server Administration - Clustering
 
Glassfish JEE Server Administration - Module 4 Load Balancer
Glassfish JEE Server Administration - Module 4 Load BalancerGlassfish JEE Server Administration - Module 4 Load Balancer
Glassfish JEE Server Administration - Module 4 Load Balancer
 
Mean shift and Hierarchical clustering
Mean shift and Hierarchical clustering Mean shift and Hierarchical clustering
Mean shift and Hierarchical clustering
 
Glassfish JEE Server Administration - The Enterprise Server
Glassfish JEE Server Administration - The Enterprise ServerGlassfish JEE Server Administration - The Enterprise Server
Glassfish JEE Server Administration - The Enterprise Server
 
Glassfish JEE Server Administration - JEE Introduction
Glassfish JEE Server Administration - JEE IntroductionGlassfish JEE Server Administration - JEE Introduction
Glassfish JEE Server Administration - JEE Introduction
 
Cluster computing
Cluster computingCluster computing
Cluster computing
 
SQL Server Clustering and High Availability
SQL Server Clustering and High AvailabilitySQL Server Clustering and High Availability
SQL Server Clustering and High Availability
 
Client Server Architecture
Client Server ArchitectureClient Server Architecture
Client Server Architecture
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Datamining intro-iep
Datamining intro-iepDatamining intro-iep
Datamining intro-iep
 

Similar a GlassFish v2 Clustering

Trouble shooting apachecloudstack
Trouble shooting apachecloudstackTrouble shooting apachecloudstack
Trouble shooting apachecloudstack
Sailaja Sunil
 
Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnet
rsnarayanan
 
One daytalk hbraun_oct2011
One daytalk hbraun_oct2011One daytalk hbraun_oct2011
One daytalk hbraun_oct2011
hbraun
 
CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
Spiffy
 
VMware Performance Troubleshooting
VMware Performance TroubleshootingVMware Performance Troubleshooting
VMware Performance Troubleshooting
glbsolutions
 

Similar a GlassFish v2 Clustering (20)

Glass Fish Portfolio Web Server Cvr
Glass Fish Portfolio Web Server CvrGlass Fish Portfolio Web Server Cvr
Glass Fish Portfolio Web Server Cvr
 
Troubleshooting Apache Cloudstack
Troubleshooting Apache CloudstackTroubleshooting Apache Cloudstack
Troubleshooting Apache Cloudstack
 
GlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium ParisGlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium Paris
 
Asadmin Webinar 12 Feb 2009
Asadmin Webinar 12 Feb 2009Asadmin Webinar 12 Feb 2009
Asadmin Webinar 12 Feb 2009
 
Trouble shooting apachecloudstack
Trouble shooting apachecloudstackTrouble shooting apachecloudstack
Trouble shooting apachecloudstack
 
Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009
 
Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...
 
Exploring App fabric
Exploring App fabricExploring App fabric
Exploring App fabric
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnet
 
One daytalk hbraun_oct2011
One daytalk hbraun_oct2011One daytalk hbraun_oct2011
One daytalk hbraun_oct2011
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
Oracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresOracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy features
 
WLS
WLSWLS
WLS
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
Embedding GlassFish v3 in Ehcache Server
Embedding GlassFish v3 in Ehcache ServerEmbedding GlassFish v3 in Ehcache Server
Embedding GlassFish v3 in Ehcache Server
 
Xap memory xtend-tutorial-2014
Xap memory xtend-tutorial-2014Xap memory xtend-tutorial-2014
Xap memory xtend-tutorial-2014
 
CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
 
VMware Performance Troubleshooting
VMware Performance TroubleshootingVMware Performance Troubleshooting
VMware Performance Troubleshooting
 

Más de Eduardo Pelegri-Llopart

Más de Eduardo Pelegri-Llopart (20)

Juggling at freenome
Juggling   at freenomeJuggling   at freenome
Juggling at freenome
 
Csumb capstone-fall2016
Csumb capstone-fall2016Csumb capstone-fall2016
Csumb capstone-fall2016
 
Digital activitymanagement
Digital activitymanagementDigital activitymanagement
Digital activitymanagement
 
Progress next iot_pelegri
Progress next iot_pelegriProgress next iot_pelegri
Progress next iot_pelegri
 
Pelegri Desarrollando en una nueva era de software
Pelegri   Desarrollando en una nueva era de software Pelegri   Desarrollando en una nueva era de software
Pelegri Desarrollando en una nueva era de software
 
Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015
 
The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015
 
IOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ ProgressIOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ Progress
 
Node.js as an IOT Bridge
Node.js as an IOT BridgeNode.js as an IOT Bridge
Node.js as an IOT Bridge
 
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts You
 
Community Update 25 Mar2010 - English
Community Update 25 Mar2010 - EnglishCommunity Update 25 Mar2010 - English
Community Update 25 Mar2010 - English
 
GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010
 
Glass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.MiniGlass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.Mini
 
Virtual Box Aquarium May09
Virtual Box Aquarium May09Virtual Box Aquarium May09
Virtual Box Aquarium May09
 
Introduction To Web Beans
Introduction To Web BeansIntroduction To Web Beans
Introduction To Web Beans
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage Patterns
 
OpenDS Primer Aquarium
OpenDS Primer AquariumOpenDS Primer Aquarium
OpenDS Primer Aquarium
 
Fuji Overview
Fuji OverviewFuji Overview
Fuji Overview
 
Nuxeo 5.2 Glassfish
Nuxeo 5.2 GlassfishNuxeo 5.2 Glassfish
Nuxeo 5.2 Glassfish
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

GlassFish v2 Clustering

  • 1. GLASSFISH V2 CLUSTERING AND LOAD BALANCING Satyajit Tripathi ISV-Engineering, Sun Microsystems 1
  • 2. GlassFish V2 UR2 Open for Business – Deploy and Redistribute for free • Latest release in August 2008 (Download). 3-Months cycle • Production Quality. First Application Server with Java EE 5 • Code base as Sun Java System Application Server 9.1 U2 • Platform Of Choice: Solaris, MS Windows, Linux, MacOS, AIX • Open Source. OSI License CDDL or GPL-v2, with CPE • Advanced features supported > Clustering (HA and Scalability). In-Memory Replication (new feature!) > Centralized Administration and Monitoring – CLI and GUI based > Web Service Interoperability and JBI (JSR 208) compliant runtime > Improved Self Management capabilities & best-in-class Performance • Attractive Support Pricing subscription based 2
  • 3. GlassFish V2 Clusters Centralized Administration, High Availability, Scalability • GlassFish V2 supports three different Administration profiles > Developer : No clustering features or NSS keystore > Cluster : Clustering features without HADB and NSS keystore > Enterprise : HADB or Network Security Services (NSS) • Setup different profiles using setup.xml or setup-cluster.xml command ${glassfish.home}/lib/ant/bin/ant -f setup-cluster.xml • Profile attribute AS_ADMIN_PROFILE in the file ${glassfish.home}/config/asadminenv.conf • Enhanced Cluster capabilities > Memory Replication or HADB (99.999%) > Dynamic Java Clustering (Project Shoal) 3
  • 5. Cluster Components Architecture • Domain Administration Server (DAS) • Node Agent • Cluster • Server Instance • Application • Group Management Service (GMS) 5
  • 7. Domain Administration Server Based on Java Management Extensions (JMX) Technology • At runtime the process manages itself, server instances, clusters, applications, and resources. Comprise of set of configuration files. • Domain Administration Server (DAS) must run on a physical host • DAS maintains Central Server Repository Cache • Delegates management of server instances to the Node Agent • By itself can serve as a fully compliant Java EE server • Command tool asadmin> > create-domain [--adminport][--profile][--domaindir] <domain-name> > start-domain <domain-name> > list-domains [--host][--port][--user][--password] • JMX (JSR3 and JSR160) compliant Managed Bean (MBean) supports dynamic resource and configuration instrumentation 7
  • 8. Node Agent Manages Server Instances on Hosting system • Controls the life cycle of server instance(s) on the host • Need to run on every physical host running server instance(s) • Delegated by the DAS to manage the server instances • Maintains local Instance Repository Cache • Synchronizes Instances with Central DAS Repository Cache • Command tool asadmin> (default master password: changeit) > create-node-agent <node-agent-name> > start-node-agent [--syncinstances=true|false] <node-agent-name> > list-node-agents • Monitors (“watchdog”) the server instance(s) and notifies DAS 8
  • 9. Cluster High Availability (HA) and Session Replication • A logical entity, binds multiple homogeneous server instances • Performs fail over between server instances transparent to LB • Heartbeat should be Enabled (GMS described later) • Command tool asadmin> > create-cluster [--host][--port] <cluster-name> > start-cluster <cluster-name> (*Starts all Server Instances) > list-clusters • HA and Session Replication can be achieved either through > Memory Replication OR > HADB • JXTATM technology for inter process communication 9
  • 10. Server Instance Java EE 5 Compliant Application Server • Server instance must run on a physical host and requires a JVM • Runs as Java EE server process and hosts Java EE application • Instances within the cluster have homogeneous configuration • Command tool asadmin> > create-instance [--host][--port][--cluster][--nodeagent] <instance-name> > start-instance <instance-name> (*Node agent must be running) > list-instances • Server Instances listen through > HTTP : Listener Port and SSL_Listener Port > IIOP : Listener Port, SSL_Listener Port and SSL_MutualAuth Port > JMS Provider Port > JMX System_Connector Port 10
  • 11. Group Management Service Enable for Dynamic Clustering and In-Memory Replication • GMS provides dynamic membership information about cluster and its member instances • Provides Notification event model for runtime shape change events in the cluster and Management Rules • Core is based on open source JXTATM (Juxtapose) technology • Provides Service Provider Interface (SPI) for plug-able group communication with cluster(s) • GMS in GlassFish Application Server monitors cluster health • GMS provides support to memory replication modules 11
  • 12. Application Configuring for High Availability • Web modules to be marked as <distributable /> in web.xml • Should support replication of session state, e.g. Http session, Stateful session bean, and Single sign-on object(s) • Should implement Serializable interface for session replication • Group Management Service (GMS) should be enabled • Configure Availability of individual application or EJB module asadmin> deploy --target <cluster-name> --availabilityenabled=true <application> • Availability of EJB Container asadmin> > set availability-service.ejb-container-availability.availability-enabled=”true” > set availability-service.ejb-container-availability.sfsb-persistence-type=”file” > set availability-service.ejb-container-availability.ha-persistence-type=”ha” • Individual Bean in file sun-ejb-jar.xml add <ejb availability-enabled=”true”> 12
  • 14. Memory Replication High Availability Techniques • Available with GlassFish V2 Cluster or Enterprise profile • JXTA technology used can handle high volume and throughput • Module uses Grizzly NIO for high I/O performance • GMS should be enabled • Properties in domain.xml to be set as persistence-type=replicated persistence-frequency=web-method | time-based persistence-scope=session | modified-session | modified-attribute • Replication relies on version of HTTP-Session, container managed cookies JSESSIONID and JSESSIONIDVERSION 14
  • 15. HADB High Availability Techniques • HADB software is supplied with SJS AS 9.1 distribution • HADB available only in the Enterprise profile and with IPv4 Ipv6 • Network should be configured as UDP multicast • Command tool asadmin> create-cluster [--host][--port][--hosts][--haagentport][--haadminpassword] <cluster-name> • Command tool asadmin> configure-ha-cluster [--host][--port][--haagentport][--haadminpassword][--autohadb] <cluster-name> • Command tool asadmin> configure-ha-persistence [--host][--port][--scope][--store=<jndi>][--type=memory|file|ha] <cluster-name> • In domain.xml override Session-Manager specific sub properties manager-properties, store-properties, session-properties 15
  • 16. Clustering Considerations Pros and Cons • Provides options for High Availability and Scalability, but has performance overheads • HADB is highly reliable, but has relatively higher cost, than Memory Replication, for Implementation and Maintenance • Memory replication is faster, but needs proper Capacity Planning to Session failover considerations • Application modifications may be required to make Session objects Serializable to enable replication across multiple JVM • Multi-tier distributed application architecture may require special considerations and configurations • Currently clustering is possible only within single Sub-net 16
  • 17. Load Balancer Architectural Choices • Software Load Balancer > Sun HTTP LB plug-in* (on SJS Web Server, Apache, Microsoft IIS) > Apache mod_jk (How to setup) • Hardware Load Balancer > Sun Secure Application Switch (General info) > F5 BIG-IP v4.5 application traffic management device (How to setup) • Dynamic Load Balancing > MBean monitors or change specific attributes using GlassFish Self Management JMX (JSR 3 and JSR 160), and > AMX, Application server Management eXtension, APIs (JSR 77) to change Application Server configurations 17
  • 18. Sun HTTP LB Plugin Features • Sticky RR Load Balancing • Support for multiple clusters • Rapid HTTP request failover (< 30 ms) • Configurable Health checking to re-enlist server • Check and reload the dynamic LB configuration changes • Support for Quiescence, enables rolling web service upgrade • Auto-retry of failed requests for idempotent URL • Configurable Error pages 18
  • 19. Load Balancer Configuration Install LB Plugin • Install a supported Web server on respective OS (matrix) • Installation of LB Plugin > Create a directory lbplugin under ${glassfish.home}/lib > Download the Sun HTTP LB Plugin jar file (aslb-9.1) > Unjar the file in the directory ${glassfish.home}/lib/lbplugin > Unzip the files SUNWaslb.zip and SUNWaspx.zip > Ensure permission 755 to directory ${glassfish.home}/lib/lbplugin/lib • Administration Console to setup Load Balancer > Create Load Balancer node and select Automatically Apply Changes > Select Targets either as Cluster or Standalone instances > Enable Cluster for load balancing > Enable Application for load balancing and failover 19
  • 21. Load Balancer Configuration Setup LB Plugin • Generate Load Balancer configuration loadbalancer.xml > asadmin create-http-lb-config --target cluster1 lb-config > asadmin enable-http-lb-server cluster1 > asadmin enable-http-lb-application --name clusterjsp cluster1 > asadmin export-http-lb-config --config lb-config loadbalancer.xml OR a single command > asadmin configure-http-lb-config --target lb-config loadbalancer.xml • Copy libpassthrough.so to ${ws.home}/plugins/lbplugin/bin/. • Copy ./errorpages to ${ws.home}/plugins/lbplugin/errorpages/. • Copy *.res to ${ws.home}/plugins/lbplugin/resource/. • Copy loadbalancer.xml to${ws.instance}/config/. • Copy sun-loadbalancer_1_2.dtd ${ws.instance}/config/. 21
  • 22. Load Balancer Configuration loadbalancer.xml • Generate Load Balancer configuration loadbalancer.xml <!DOCTYPE loadbalancer PUBLIC quot;-//Sun Microsystems Inc.//DTD Sun One Application Server 8.1//ENquot; quot;sun-loadbalancer_1_2.dtdquot;> <loadbalancer> <cluster name=quot;cluster1quot; policy=quot;round-robinquot;> <instance name=quot;instance1quot; enabled=quot;truequot; disable-timeout-in-minutes=quot;60quot; listeners=quot;http://host:port1quot; weight=quot;100quot;/> <instance name=quot;instance2quot; enabled=quot;truequot; disable-timeout-in-minutes=quot;60quot; listeners=quot;http://host:port2 weight=quot;100quot;/> <web-module context-root=quot;clusterjspquot; enabled=quot;truequot; disable-timeout-in-minutes=quot;60quot; error-url=quot;sun-http-lberror.htmlquot; /> <health-checker url=quot;/quot; interval-in-seconds=quot;10quot; timeout-in-seconds=quot;30quot; /> </cluster> <property name=quot;reload-poll-interval-in-secondsquot; value=quot;60quot;/> <property name=quot;response-timeout-in-secondsquot; value=quot;30quot;/> <property name=quot;https-routingquot; value=quot;truequot;/> <property name=quot;require-monitor-dataquot; value=quot;truequot;/> <property name=quot;active-healthcheck-enabledquot; value=quot;falsequot;/> <property name=quot;number-healthcheck-retriesquot; value=quot;3quot;/> <property name=quot;rewrite-locationquot; value=quot;truequot;/> </loadbalancer> 22
  • 23. Load Balancer Configuration Web Server Configuration • Modify ${ws.instance}/config/magnus.conf ##BEGIN EE LB Plugin Parameters Init fn=quot;load-modulesquot; shlib=quot;${ws.home}/plugins/lbplugin/bin/libpassthrough.soquot; funcs=quot;init-passthrough,service-passthrough,name-trans-passthroughquot; Thread=quot;noquot; Init fn=quot;init-passthroughquot; ##END EE LB Plugin Parameters • Modify ${ws.instance}/config/obj.conf NameTrans fn=quot;name-trans-passthroughquot; name=quot;lbpluginquot; config-file= quot;${ws.instance}/config/loadbalancer.xmlquot; And <Object name=quot;lbpluginquot;> ObjectType fn=quot;force-typequot; type=quot;magnus-internal/lbpluginquot; PathCheck fn=quot;deny-existencequot; path=quot;*/WEB-INF/*quot; Service type=quot;magnus-internal/lbpluginquot; fn=quot;service-passthroughquot; Error reason=quot;Bad Gatewayquot; fn=quot;send-errorquot; uri=quot;$docroot/badgateway.htmlquot; </Object> 23
  • 24. GlassFish V2 Resources • GlassFish V2 Cluster : Developer Technical Article • Training and Certification On Java EE technologies • GlassFish Project : http://glassfish.dev.java.net > Download: previews, current and past releases, plug-ins > Learning: documentation, tutorials, technical articles, flash demos > Community Aquarium: latest news, forums, events, mailing lists • GlassFish Wiki : http://wiki.glassfish.java.net • Bug list : Priority P1 and P2 • Users Alias : <users@glassfish.dev.java.net> 24
  • 25. GLASSFISH V2 CLUSTERING AND LOAD BALANCING Satyajit Tripathi http://blogs.sun.com/stripathi 25