© JBoss Inc. 2006 JBoss Clustering An Overview Bela Ban Lead JGroups, Manager Clustering Group.

Slides:



Advertisements
Similar presentations
Distributed Processing, Client/Server and Clusters
Advertisements

COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
The road to reliable, autonomous distributed systems
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
A DAPT IST Replication Framework: Progress Report Vance Maverick University of Bologna Dec. 11, 2003.
Distributed components
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
Enterprise Applications & Java/J2EE Technologies Dr. Douglas C. Schmidt Professor of EECS.
Component-Based Software Engineering Introducing the Bank Example Paul Krause.
Chris Shuster 4/29/2009 1Chris Shuster.  Application Servers ◦ Backend processing platform. ◦ Multiple platforms, operating system and architecture.
Basic Services: Architecture Options Vance Maverick ADAPT Bologna Feb. 13, 2003.
Lesson 1: Configuring Network Load Balancing
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
.NET Mobile Application Development Introduction to Mobile and Distributed Applications.
.NET Mobile Application Development Remote Procedure Call.
Lecture 8 Epidemic communication, Server implementation.
Load Sharing and Balancing - Saravanan Mathialagan Masters in Computer Science Georgia State University.
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Module 13: Network Load Balancing Fundamentals. Server Availability and Scalability Overview Windows Network Load Balancing Configuring Windows Network.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
PowerTier EJB in High-Performance Applications John Killoran European Technical Services Manager Persistence Software.
Introduction to Ice Copyright © ZeroC, Inc. Ice Programming with Java 1. Introduction to Ice.
INSTALLING MICROSOFT EXCHANGE SERVER 2003 CLUSTERS AND FRONT-END AND BACK ‑ END SERVERS Chapter 4.
Bologna, 19th-20th February 20045th Plenary TAPAS Workshop JBoss Clustering and Configuration Service Implementation Giorgia Lodi
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
JBoss Cache. Cache A place to temporarily store data that is expensive or difficult to compute or retrieve. Caches should be fast to access. May or may.
TRƯỜNG ĐẠI HỌC CÔNG NGHỆ Bộ môn Mạng và Truyền Thông Máy Tính.
Replication & EJB Graham Morgan. EJB goals Ease development of applications –Hide low-level details such as transactions. Provide framework defining the.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
GigaSpaces Global HTTP Session Sharing October 2013 Massive Web Application Scaling.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Eric Tryon Brian Clark Christopher McKeowen. System Architecture The architecture can be broken down to three different basic layers Stub/skeleton layer.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Cloud Computing Computer Science Innovations, LLC.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Institute for Visualization and Perception Research 1 © Copyright 1999 Haim Levkowitz Java-based mobile agents.
1 Distributed Systems Distributed Object-Based Systems Chapter 10.
.NET Mobile Application Development XML Web Services.
(1) Dynamic Proxies in Java And so on into winter Till even I have ceased To come as a foot printer, And only some slight beast So mousy or foxy Shall.
Distributed objects and remote invocation Pages
Distributed File System. Outline Basic Concepts Current project Hadoop Distributed File System Future work Reference.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Presented by Deepak Varghese Reg No: Introduction Application S/W for server load balancing Many client requests make server congestion Distribute.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Replication & Fault Tolerance CONARD JAMES B. FARAON
Affinity Depending on the application and client requirements of your Network Load Balancing cluster, you can be required to select an Affinity setting.
Network Load Balancing
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Distribution and components
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
Inventory of Distributed Computing Concepts
Distributed Object-based systems
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Component-based Applications
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

© JBoss Inc JBoss Clustering An Overview Bela Ban Lead JGroups, Manager Clustering Group

2 © JBoss Inc Topics What is clustering? JBoss/JEMS Clustering Components JGroups, JBoss Cache, HA-JNDI, SLSBs, SFSBs, HTTP session replication, Entity beans, EJB3 and POJO Clustering

3 © JBoss Inc Why JBoss Clustering? Transparent No stub re-compiling! Client doesn’t know about clustering aspect Cluster is maintained automatically Modular/stack approach Open source No extra cost to activate clustering Fairly robust 24/7 production support

4 © JBoss Inc Clustering Terminology Scalability I want to handle x times the number of concurrent access than what I have now High availability Services are accessible with reasonable (and predictable) response times at any time E.g., (5 Nines in Telco) Load balancing A way to obtain high availability and better performance by dispatching incoming requests to different servers Session affinity (or stickiness) Failover Process can continue when it is re-directed to a “backup” node because the original one fails State needs to be available on backup Fault tolerance A service that guarantees strictly correct behavior despite system failure

5 © JBoss Inc Clustering Overview Load Balancer State Replication Failover R1 R2 R3

6 © JBoss Inc JBoss Thin Client Clustering Front end load balancer Software Apache httpd and JBossWeb Apache with mod_jk/mod_proxy JBossWeb (Tomcat on steroids) Hardware F5 Big IP

7 © JBoss Inc JBoss Fat Client Clustering Client uses smart proxy retrieved from JNDI HA smart proxy Based on Remoting (EJB3.0) or RMI (EJB2.1) Has load balancing policy, e.g., Round-Robin Has failover capability (sticky), e.g., detect call failure HA smart proxy has logic inside Logic is pluggable, users can provide their own Failover policy Load balancing, e.g. based on load or weight

8 © JBoss Inc Running JBoss Cluster – Basic Steps Use JBoss’ “all” configuration run.bat -c all./run.sh -c all The “all” configuration contains everything needed for clustering: It has all the libraries for clustering JGroups.jar, jboss-cache.jar Clustered beans (cluster-service.xml) HA-JNDI HTTP session replications (tc5-cluster- service.xml) Farming HA-JMS

9 © JBoss Inc Clustering divided in 3 parts Client-cluster communication Formerly HA-RMI, no HA-Remoting Load balancing and failover logic for fat clients State replication (inside cluster) JBoss Cache HTTP session, SFSBs, DistributedState Cluster communication (inside cluster) Method calls across all cluster nodes Cache invalidation, HA-JNDI, Farming

10 © JBoss Inc Clustering Stack JGroups JBossCache DRM HA-JNDI HTTP SFSB Entity Hibernate Distributed RPC, Membership Messaging HAServices DRM Farming HA- Singleton HA- Remoting Distributed State jBpm

11 © JBoss Inc What is JGroups? A reliable group messaging library Reliable messaging Sequence ordering FIFO or total ordering Flow control Acknowledgement Fragmentation Manage group membership Join Leave Shun

12 © JBoss Inc What is JBoss Cache? An in-memory, replicated, transactional, persistent, and fine- grained cache system Uses JGroups as the messaging layer Ideal for state replication Transactional Persistent (and passivation) Fine-grained field-level replication Sub-partitioning, Buddy Replication

13 © JBoss Inc HA-JNDI Clustered JNDI

14 © JBoss Inc Local proxies Local proxies have direct reference to container localInvoke() creates invocation in container Remote proxies Remote proxies create invocation on client (method, args, ObjectName) Communicate via Remoting framework HA Smart Proxies Client JVM Dispatcher Server JVM Typed Interface Remote Proxy Remoting Connector Remoting Connector AOP Container Invocation Port 3873 Client dynamicInvoke(Invocation) localInvoke(Method, args) Local client Typed Interface Local Proxy JBoss Remoting

15 © JBoss Inc JBoss Remoting JBoss Remoting is a framework with a single, simple API for making network based invocations and other network related services. Client – the external API access point for client code. Client/Server Invoker – protocol specific implementation. For example, SocketClientInvoker and SocketServerInvoker. Invocation Handler – end target interface implemented by user that receives the invocation from the client.

16 © JBoss Inc SFSB Configuration in EJB 2   ClusteredSessionBean  True   MyPartition   org.jboss.ha.framework.interfaces.RoundRobin   org.jboss.ha.framework.interfaces.FirstAvailable   ClusteredSessionBean  True   MyPartition   org.jboss.ha.framework.interfaces.RoundRobin   org.jboss.ha.framework.interfaces.FirstAvailable 

17 © JBoss Inc (loadBalancePolicy = FirstAvailable.class, partition = ”MyPartition”) public class ClusteredSessionBean implements ClusteredSession { } (loadBalancePolicy = FirstAvailable.class, partition = ”MyPartition”) public class ClusteredSessionBean implements ClusteredSession { } SFSB Configuration in EJB3

18 © JBoss Inc Entities Use JBoss Cache as Hibernate’s 2nd level cache Default cache in ejb3-entity-cache-service.xml jboss.cache:service=EJB3EntityTreeCache Configure in META-INF/hibernate.cfg.xml per app

19 © JBoss Inc Entities org.jboss.ejb3.entity.TreeCacheProviderHook jboss.cache:service=EJB3EntityTreeCache org.jboss.ejb3.entity.TreeCacheProviderHook jboss.cache:service=EJB3EntityTreeCache

20 © JBoss Inc. public class Pojo long int public class Pojo long int cacheID; } Common set @Remote Integration into EJB3 (detach and attach extended to replication)

21 © JBoss Inc HTTP Session Replication JBossWeb Replication granularity Session Modified attributes Modified fields Implemented using JBoss Cache

22 © JBoss Inc Granularity: SESSION Entire http session is replicated User defines whether getAttribute() call marks a session as dirty If attribute value is mutable, the application can modify session state without calling setAttribute() Operates blindly (application may not have changed the object) After each HTTP request the entire session is serialized and replicated

23 © JBoss Inc Granularity: SESSION // … if replication triggered by getAttribute() is disabled: Pojo pojo = (Pojo)session.getAttribute(“pojo”); pojo.setName(“Ben”); session.setAttribute(“pojo”, pojo); // Done manually to replicate the session // … if replication triggered by getAttribute() is enabled: Pojo pojo = (Pojo)session.getAttribute(“pojo”); // Session will be replicated return pojo.getName(); // Pojo was not actually changed // … if replication triggered by getAttribute() is disabled: Pojo pojo = (Pojo)session.getAttribute(“pojo”); pojo.setName(“Ben”); session.setAttribute(“pojo”, pojo); // Done manually to replicate the session // … if replication triggered by getAttribute() is enabled: Pojo pojo = (Pojo)session.getAttribute(“pojo”); // Session will be replicated return pojo.getName(); // Pojo was not actually changed

24 © JBoss Inc Granularity: ATTRIBUTE Only attributes marked as dirty are replicated. More efficient than session granularity User still needs to manage object relationship Can still configure whether getAttribute() marks the attribute as dirty Pojo pojo = (Pojo)session.getAttribute(“pojo”); pojo.setName(“Ben”); session.setAttribute(“pojo”, pojo); // Only attribute “pojo” gets replicated! Pojo pojo = (Pojo)session.getAttribute(“pojo”); pojo.setName(“Ben”); session.setAttribute(“pojo”, pojo); // Only attribute “pojo” gets replicated!

25 © JBoss Inc Granularity: FIELD Replication is on Pojo field level where Pojo has to be instrumented with AOP Annotation or XML Object relationships are maintained Available beginning with JBoss Person joe = (Person)session.getAttribute(“joe”); joe.setName(“joe”); // Only this field gets replicated. Person mary = (Person)session.getAttribute(“mary”); mary.setAge(41); // Only this field gets replicated. Address addr = new Address(“San Jose”, 95123); joe.setAddress(addr); mary.setAddress(addr); // addr only gets replicated once; shared ref is maintained Person joe = (Person)session.getAttribute(“joe”); joe.setName(“joe”); // Only this field gets replicated. Person mary = (Person)session.getAttribute(“mary”); mary.setAge(41); // Only this field gets replicated. Address addr = new Address(“San Jose”, 95123); joe.setAddress(addr); mary.setAddress(addr); // addr only gets replicated once; shared ref is maintained

26 © JBoss Inc Granularity: FIELD When a Pojo object size is huge, e.g., a long List of size 100K, field level replication is efficient! Subsription subs = (Subscription)session.getAttribute(“subscription”); // What if list is size of 100K? List mailingList = (List)subs.getMailingList(); Person joe = findSubscriber(“joe”, mailingList); joe.getAddress().setZip(94086); // Only replicates this field!! Subsription subs = (Subscription)session.getAttribute(“subscription”); // What if list is size of 100K? List mailingList = (List)subs.getMailingList(); Person joe = findSubscriber(“joe”, mailingList); joe.getAddress().setZip(94086); // Only replicates this field!!

27 © JBoss Inc Clustering – Configuration Session replication is enabled per web application in WEB-INF/web.xml Add to your webapp JBoss specific stuff (async vs sync replication) goes into WEB-INF/jboss- web.xml

28 © JBoss Inc Links Details on Clustering Documentation JBoss AS chapters 16 (Clustering) & 17 (JBossCache and JGroups) Webinars cation Training stering (next: Berlin March 21-24)

© JBoss Inc Questions ?