jboss application platform assistance version

41
Chungnam National University Computer Science and Engineering Database System Laboratory Database System Laboratory Seminar Database System Laboratory Seminar 임임임 ([email protected] ) 임임임임임 임임임임임임 임임임임임임임임임 임임임 22-6-20 임임임 JBoss Application Platform JBoss Application Platform Assistance Version Assistance Version

Upload: dyani

Post on 05-Jan-2016

54 views

Category:

Documents


1 download

DESCRIPTION

JBoss Application Platform Assistance Version. 임형준 ( [email protected] ) 충남대학교 컴퓨터공학과 데이터베이스시스템 연구실 2014년 10월 23일 목요일. 목차. JBoss Application Platform Review JBoss Enterprise Middleware System JGroup JBoss Cache Performance Decline Factors Clustering State Replication - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory SeminarDatabase System Laboratory Seminar

임형준 ([email protected])충남대학교 컴퓨터공학과

데이터베이스시스템 연구실23-4-20 목요일

JBoss Application PlatformJBoss Application PlatformAssistance VersionAssistance Version

Page 2: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

목차목차

JBoss Application Platform Review JBoss Enterprise Middleware System

JGroupJBoss Cache

Performance Decline FactorsClustering State Replication Load-balancing Failover

2

Page 3: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBoss Enterprise Middleware JBoss Enterprise Middleware SystemSystem

Page 4: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

JEMS ArchitectureJEMS Architecture

4

Operating System (Windows, Unix = Linux, Solaris, AIX, etc.)

Hardware (CPU + Storage + Memory)

Java Virtual Machine (Sun JVM, BEA JRockit, IBM VM, etc.)

JBoss Application Server 4.x (JMX Microkernel : JBossMX)

Cu

sto

m M

be

an

s

Services beyond J2EE

Pe

rsis

ten

ce (

Hib

ern

ate

*)

Clu

ste

ring

Ca

chin

g (

JBo

ssC

ach

e*)

Wo

rkflo

w (

JBo

ss jB

PM

**)

JBo

ss A

OP

*

Java

Ap

plic

atio

ns

Java Applications (EARs, WARs, JARs, JSPs, Servlets)

JBo

ss E

clip

se I

DE

JBoss Portal

--- J2EE 1.4 Services implemented as JMX Mbeans ---

JSP

/Se

rvle

t (T

om

cat*

)

JND

I (J

Bo

ssN

S)

WS

4E

E (

JBo

ssW

S)

JDB

C

JMS

(JB

oss

MQ

)

EJB

(JB

oss

CM

P)

JTA

(JB

oss

JTA

)

SA

AJ

JAC

C

JCA

(JB

oss

JCA

)

JAA

S (

JBo

ssS

X)

RM

I-II

OP

(ja

cOR

B)

JAX

-RP

C

De

plo

yme

nt

AP

I

JAX

R

Ma

na

ge

me

nt

AP

I

* Product can run inside JBoss AS or stand-alone** Integration as MBean under development

JAX

P

JBo

ss R

em

otin

g*

Page 5: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JGroup & JBoss CacheJGroup & JBoss Cache

Page 6: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

JGroupsJGroups

Toolkit for reliable multicastingFragmentationMessage retransmissionOrderingGroup membership, membership changenotification

LAN or WAN based Like JMS

Receive a messageRetrieve membershipDisconnect from the groupClose the channelBe notified when members join, leave (including crashes)

6

Group topology

Page 7: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rmJGroups (Layered) JGroups (Layered) ArchitectureArchitecture

7

Channel

GMS

UNICAST

UDP

FD

NAKACK

Channel

GMS

UNICAST

UDP

FD

NAKACK

Network

Application Application

Building

Blocks

Building

Blocks

Channel

Application

send() receive()

Channel

Application

send() receive()

Protocol Stack ViewProtocol Stack View Pipe & Filter ViewPipe & Filter View

Queue & Tread

Page 8: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rmFlexible Protocol Stack & Flexible Protocol Stack & Code SampleCode Sample

2 threads per protocolCan be optimized away, per protocol down_thread="false", up_thread="false"

Cause the up() or down() to run on caller's thread A protocol implements up() and/or down() methods When done, pass message on: passUp(), passDown()

methods

Tradeoff between performance/concurrency and context switching

Code Sample

8

public void JGroupsSample () { JChannel channel = new JChannel("file://home/bela/default.xml"); channel.connect("demo-group"); // join the group System.out.println("members are: " + channel.getView().getMembers()); Message msg = new Message(null, null, "Hello world"); channel.send(msg); Message m=(Message)channel.receive(0); System.out.println("received msg from " + m.getSrc() + ": " + m.getObject()); ch.disconnect(); // Leave from “demo-group“ ch.close();

}

Page 9: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rmAdvantages of Protocol Advantages of Protocol StacksStacks

Each property is implemented by 1 protocolFragmentation, retransmission, ordering

Protocols are assembled into a stack Stack has exactly the properties needed by the

appl / required by the network Can‘t get this with java.net.Socket, always

comes with full TCP/IP Small scope: a protocol does just one job, but

does it well Protocol stacks are fashionable:

Servlet 2.3 filtersInterceptors (Corba, JBoss)AOP: separation of concerns, e.g. fragmentation should not be an application concern

9

Page 10: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Available ProtocolsAvailable Protocols

Transport: UDP, TCP, TCP_NIO, TUNNEL, JMS, LOOPBACK

Discovery: PING, TCPPING, TCPGOSSIP, UDPPING Group membership Ordering: FIFO, CAUSAL, TOTAL, TOTAL_TOKEN Security: ENCRYPT, SSL ConnectionTable (n/a) Fragmentation: FRAG Flow control: FLOW_CONTROL, FC Misc: PIGGYBACK, COMPRESS Reliable delivery & FIFO: NAKACK, SMACK,

UNICAST Failure detection: FD, FD_SOCK, FD_PID,

FD_SIMPLE, FD_PROB, VERIFY_SUSPECT State transfer: STATE_TRANSFER

10

Page 11: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Group MembershipGroup Membership

Group MembershipMaintain a list of membersNotify members when a new member joins, or an existing member leaves (or crashes)Each member has the same ordered listList can be retrieved by Channel.getView()First (= oldest) member is coordinatorIf coordinator crashes, 2nd oldest takes over

ActionsJOINLEAVE Member sends LEAVE to coordinator Coordinator multicasts new view to all members

CRASH GMS multicasts new view (not containing crashed member)

11

If (first member) {Coordinator adds new member to list, and multicasts new view (member list) to all

members} else { sends JOIN to coordinator }

Page 12: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

JBoss CacheJBoss Cache

A replicated, transactional, persistency and fine-grained cache system

Transactional or non-transactionalNon-Transactional Replication after each modification

Transactional Replication at TX commit DB isolation levels supported Support for pluggable TxManagers

12

Page 13: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

JBoss Cache ModuleJBoss Cache Module

Two modules TreeCacheTreeCacheAOP

Uses JGroups as underlying transport stack

13

Page 14: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

TreeCache ArchitectureTreeCache Architecture

Tree structureEach node has a name and zero or more childrenCan be navigated recursively from node to node or using a fully qualified name (/a/d/g) : like xpathMultiple roots per cache allowedEach node is a map with keys and values

LockingIsolation level per node

DrawbackCoarse grained Replication replicate a big object even only a sub-field is dirty

InterfaceNode put(FQN name, Object key, Object value) Insert a (key, value) pairObject get(FQN name, Object key) Finds by key with node nameremove(FQN name, Object key)

14

a

dc

e gf

h

Page 15: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

TreeCacheAOPTreeCacheAOP

Subclass of TreeCache POJO needs not be Serializable (but needs

instrumentation) Fine-grained field-level Pojo Cache

Object graph Sub-object reference, Cross and multiple referencePolymorphismInheritance

Use JBossAop’s Dynamic AOP feature Eviction policy Object management transparency

Once the object is put into cache, regular POJO field operation will trigger appropriate replication. (ex : a method call, field access, instance construction) It’s Kind Of AOP MagicIf under transaction, the POJO operation is transacted as well. Automatic Collection class support List, Map, and Set A proxy is generated for the Collection. User operates on the proxy

15

Page 16: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

TreeCacheAop MappingTreeCacheAop Mapping

16

Person p (key=/husband)

name: „Joe“

addr

hobbies

city: „ San Jose“

zip: 95123

/

husband

addr

city

zip 95123

San Jose

hobbies

1 20

wife

Person p (key=/wife)

name: „Mary“

addr

hobbies

name Joe name Mary

Page 17: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rmTreeCacheAOP is a JBoss AOP TreeCacheAOP is a JBoss AOP ProductProduct

17

Person.java

Jboss-aop.xml

AopMarker.java

package org.jboss.cache.aop;// Annotation marker interfacePublic interface AopMakrer {}

/** * @@org.jboss.aop.cache.AopMarker */ Public class Address { String tel; String street; int zip;…}

<aop><prepare expr="field(* $instanceof{org.jboss.cache.aop.AopMarker}->*)" /></aop>

street seoul myung-dong

tel 083)231-234

zip 33098

www objectworld.org

update

Page 18: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rmTreeCacheAOP Interface & TreeCacheAOP Interface & ConfigurationConfiguration

18

<server><mbean code="org.jboss.cache.aop.TreeCacheAop" name="jboss.cache:service=TreeCacheAop"> ...<attribute name=“TransactionManagerLookupClass"> org.jboss.cache.transaction.JBossTransactionManagerLookup</attribute> <attribute name="IsolationLevel">REPEATABLE_READ</attribute> <attribute name="CacheMode">REPL_SYNC</attribute>

...

replySync-service.xml

TreeCacheAop cache = new TreeCacheAop();PropertyConfigurator configurator = new PropertyConfigurator();// Configuration via xmlConfigurator.config(cache, “META-INF/replSync-serivce.xml”);

cache.start();

Person joe = new Person(“Joe Black”, 51);// Put object into cache managementcache.putObject(“/person/joe”, joe);// Fine grained replication here. Only the age field is replicated!cache.getObject(“/person/joe”).setAge(61);// Remove it from the cache managementcache.removeObject(“/person/joe”);assert(null == cache.findObject(“/person/joe”));

Code

Page 19: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

ClusteringClustering

Page 20: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Performance Decline FactorsPerformance Decline Factors

부하분산 (State Replication)동시 접속자 증가에 따른 성능저하 방지요청을 서버들에 전달하여 고가용성 및 성능향상

상태복제 (Load Balancing)서비스 접근 시 응답속도의 항상성 유지클러스터 내의 모든 노드들이 상태 접근가능하나의 노드가 장애 시 다른 노드에서 클라이언트와 통신하여 서비스 제공

자동 장애복구 (Silent Failover)서비스 장애 시 정상적인 서비스 보장시스템 장애 시 클라이언트는 다른 노드로 redirection

20

Page 21: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

ClusteringClustering

High availability enterprise services via JBoss Clusters

To run an application on several parallel servers (cluster nodes) while providing a single view to application clients

Clustering is crucial forScalable enterprise applications: improve performance by simply adding more nodes to the clustersHighly available enterprise applications: support the redundancy

21

Page 22: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

JBoss Clustering IncludesJBoss Clustering Includes

ClusterSet of nodes with a common goal - HomogeneousPartition - Group of nodesNot statically definedDefined by a nameNode can join and leave as neededAutomatic cluster membership discovery

HA-SingletonOnly node is running at the same time in a cluster

22

Page 23: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Clustering Clustering 구성구성

On the same network, even for the same service, they may have different clusters (partition)

23

Partition A

JbossNode 1

JbossNode 2

JbossNode 3

Partition B

JbossNode 4

JbossNode 5

Partition C

JbossNode 1

Clusters and server nodes

Page 24: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Clustering Clustering 방법방법 상태 복제 (State Replication) – 아래 항목에 대해

Synchronous & Asynchronous Replication 모드 지원HTTP SessionStateful Session BeanEntity BeanPlain Old Java Bean (POJO)

부하 분산 (Load Balancing)HTTP Load-balancing via Apache Plug-inEJB Load-balancing via Dynamic ProxyMessage-Driven Bean Load-balancing via Queue

자동 장애 복구 (Silent Failover)HTTP failover via Apache Plug-inEJB failover via Dynamic Proxy

24

Page 25: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Clustering ExpressionClustering Expression

25

JBossWeb

JBossWeb

SFSB

EJB 3

Entity Bean

POJO

SFSB

EJB 3

Entity Bean

POJO

JBoss instance

JBoss instance

Fat Client

ApacheThin Client

Remoting

HTTP

Page 26: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Clustering Clustering 동작동작

Farming DeploymentJBoss deployment scanner 가 변경사항을 감지해서 클러스터의 각 노드에 자동으로 deploy

Dynamic Cluster Definition특정 노드 장애 발생시 , 클러스터의 각 노드 및 클라이언트의 클러스터 정의에서 동적으로 해당 노드를 제거

26

Page 27: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Farming DeploymentFarming Deployment

Hot-deployAny of the cluster members and the application will be automatically duplicated across all nodes in the same cluster by simply copying a file in a /farm folder

27

Page 28: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Configuration FileConfiguration File

28

<?xml version="1.0" encoding="UTF-8"?><server>

<mbean code="org.jboss.ha.framework.server.FarmMemberService"name="jboss:service=FarmMember,partition=DefaultPartition">...<depends optional-attribute-name="ClusterPartition"proxy-type="attribute">jboss:service=${jboss.partition.name:DefaultPartition}</depends><attribute name="ScanPeriod">5000</attribute><attribute name="URLs">farm/</attribute>...</mbean></server>

farm-service.xml

Page 29: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Dynamic Cluster DefinitionDynamic Cluster Definition

29

If any node fails, the cluster will identify the failure and remove that node from the cluster definition of every

node and all client proxies.

If any node fails, the cluster will identify the failure and remove that node from the cluster definition of every

node and all client proxies.

All nodes in a JBoss cluster are peers. There is no central director of the

cluster, which eliminates any single point of failure.

All nodes in a JBoss cluster are peers. There is no central director of the

cluster, which eliminates any single point of failure.

To add a node to the cluster simply duplicate a drive of an existing node, give the

node a unique name/IP, and connect it to the network.

To add a node to the cluster simply duplicate a drive of an existing node, give the

node a unique name/IP, and connect it to the network.

Now all of the nodes in the cluster and all client proxies are aware of the new cluster member. Node five is now

included in all state replication operations as

well.

Now all of the nodes in the cluster and all client proxies are aware of the new cluster member. Node five is now

included in all state replication operations as

well.two

one

fourthree fourfive

five

one

Cluster Definitiononetwo

threefour

Cluster Definitiononetwo

threefourfive

Cluster Definitiontwo

threefourfive

Page 30: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

상태 복제 상태 복제 (State Replication)(State Replication)

Page 31: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

State Replication (1)State Replication (1)

Fine-Grained State Replication Object 변경 시 Object 전체가 아닌 , field level 의 변경 사항만을 복제

Synchronous VS. Asynchronous상태 복제를 동기화할 경우 , 노드 장애 시 항상 상태 정보를 최신으로 유지할 수 있으나 성능은 떨어짐어느 정도의 상태 정보 손실이 발생해도 문제가 없다면 상태 정보 복제를 비동기화해서 성능을 개선 ( 동기화 주기 설정 가능 )

31

Page 32: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

SFSB ReplicationsSFSB Replications

After each invocation of a SFSB, if the bean changed, a message is broadcast to the cluster

The message contains the serialized state of the session bean

The broadcast operation is synchronous (blocking) with acknowledgements from all the nodes of the cluster

32

TreeCacheAOP

SFSB

2. register1. new 3. Notify to other node TreeCacheAOP

5. update4. Update state 6. Notify to other node TreeCacheAOP

Automatic TreeCacheAOP Notification

Page 33: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rmState Replication Across State Replication Across ClusterCluster

33

one

fivetwo

fourthree

::::::::::::::::::::::::::::::::::::::::::::::::

4

4

QTY

$2.25Coffee Mugs25

$1.99Coffee Filters #42

$6.59Coffee Beans (1lb)1

Unit Price

Product DescriptionLine#

Shopping Cart

1 0

Now all nodes in the cluster are in sync with the updated state of the

shopping cart.

Now all nodes in the cluster are in sync with the updated state of the

shopping cart.

Replicated ObjectsHttpSessions

Stateful Session BeansHA-JNDI tree

Page 34: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

State Replication (2)State Replication (2)

Buddy Replication & Data Gravitation for HTTP Session

상태 정보를 하나 이상의 buddy node (backup server) 에만 복제HTTP 요청이 오면 해당 노드는 cluster 에서 상태 정보를 복제Failover 일 경우 , HTTP 요청이 반드시 buddy node 로 전달되지는 않음Sticky load-balancing (session affinity) 사용

34

Page 35: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

부하부하 분산 분산 (Load-balancing)(Load-balancing)

Page 36: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Load-balancerLoad-balancer

HTTP-based services do not require the client to download anything

External load balancer is required to process all requests and dispatch them to server nodes in the cluster

36

Load

-bala

ncer

JbossNode 1

JbossNode 2

WebBrowser

SessionsReplications

11.2

1.1

1.3

Page 37: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Load-balancingLoad-balancing

HTTP Load-balancingApache Plug-in (mod-jk) Load-balancing 정책 Weight Round Robin Lowest Session Lowest Network Traffic Lowest Current Load

EJB Load-balancing via Dynamic ProxyEJB Stub (Proxy) 에서 제어Load-balancing 정책 Round Robin First Available First Available with identical all proxies

Message-Driven Bean Load-balancing via Queue

37

Page 38: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Database System Laboratory Seminar

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

자동자동 장애 복구 장애 복구 (Failover)(Failover)

Page 39: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

FailoverFailover

HTTP failoverL4, Apache Plug-in (mod_jk) 에서 제어노드 장애 발생 시 다른 노드로 요청을 전달

EJB failoverEJB Stub (Dynamic Proxy) 에서 제어노드 장애 발생 시 다른 노드로 요청모든 노드가 장애가 발생할 경우 Client 에게 Exception 전달장애가 발생한 노드는 Cluster 에서 제외변경된 Cluster 구성 정보는 EJB 응답 메시지에 추가되어 Stub 으로 전달

39

Page 40: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rm

Client-Server CommunicationClient-Server Communication

The clients downloads an “intelligent” stub from the server and uses it to access the bean

The stub encapsulates the load balancing policy and the failover mechanism

JBoss provides load balance policies:RoundRobinFirstAvailable (Sticky Sessions)FirstAvailableIdenticalAllProxies

The stubs maintains a list of server addresses which is updated on each request

40

Client

Inte

llige

nt S

tub

: Server Address List

: Server Address Reference

InvokeInvokeNode 1Node 1

Node 2Node 2RM

I D

ispatc

her fault

Page 41: JBoss Application Platform Assistance Version

Chungnam National UniversityComputer Science and EngineeringDatabase System Laboratory

JBos

s Ap

plica

tion

Serv

erJB

oss

Appl

icatio

n Pl

atfo

rmSilent Failover via Dynamic Silent Failover via Dynamic ProxiesProxies

41

two

one

five

fourthree

DynamicProxy

ClientApplication

= replicated stateful object (e.g. Stateful Session Bean)

Current Cluster Nodes

onetwo

threefour

Dynamic proxies are provided out-of-box in

JBoss. The client application does not know or care that the

server has failed-over.

Dynamic proxies are provided out-of-box in

JBoss. The client application does not know or care that the

server has failed-over.