judcon london 2011 - elastic soa on the cloud, steve millidge

45

Upload: c2b2-consulting

Post on 23-Jan-2015

962 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge
Page 2: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Elastic SOA on the CloudSteve Millidge (C2B2)

Page 3: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

About Me• Founder of C2B2

– Red Hat Partner– Deep Expertise in Middleware– Non-functional Experts

• 20 Years Middleware Expertise• 15 years Field Consultancy• Organiser of JBUG London

– http://www.meetup.com/JBoss-User-Group/

Page 4: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Agenda

• SOA Reprise• Cloud Reprise• Why SOA on the Cloud?• JON Overview• Deploying ESB for Elasticity• Service Deployment Options

Page 5: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

SOA Reprise

Page 6: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Typical SOA Architecture

JBoss Enterprise Service Bus

jBPM BAM

System 1 System 2 System 3 System 4

Page 7: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Typical ESB Service

Components• Inbound Listener

– JMS, File, FTP, Web Service, HTTP(s) …

• Action Pipeline– Transformation, Routing,

Process Coordination, Auditing, Aggregation

• Outbound Protocol– Calls System Business

Logic– EJB, Web Service …

Action Pipeline

Inbound Listener

Outbound Protocol(JMS, HTTP, REST)

Page 8: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Service Definition<?xml version = "1.0" encoding = "UTF-8"?><jbossesb

xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" invmScope="GLOBAL">

<services> <service category="Retail" name="ShoeStore" description="Acme Shoe

Store Service"> <actions> <action name="println" class="org.jboss.soa.esb.actions.SystemPrintln"

/> </actions> </service></services>

</jbossesb>

Page 9: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Cloud Reprise

Page 10: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Infrastructure As A Service

Virtual Image Store

ServerServerServerDatabaseLoad Balancer

Page 11: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Amazon EC2

EC2 Core Features• AMI• Instance

– Spot, On-Demand, Dedicated

• Volumes– Snapshots

• Security Groups• Load Balancers• Elastic IPs

Peripheral Services• Cloud Front• Cloud Watch• Cloud Formation• RDS• VPC• Elastic Beanstalk

Page 12: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Starting an InstanceFrom Java

String imageID = “ami-xxxxxx”;String minInstances = 3;String maxInstances = 3;

RunInstancesRequest request = new RunInstancesRequest(imageID,minInstances, maxInstances);

AmazonEC2Client client = new AmazonEC2Client(new AWSCredentials(…));

RunInstancesResult result = client.runInstances(request);

Page 13: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Amazon Instance TypesInstance Type Memory (GB) CPU (ECU) Cost per Hour

Standard Small 1.7 1 $0.095

Standard Large 7.5 4 $0.38

Standard XL 15 8 $0.76

High Mem XL 17 6.5 $0.57

High Mem DXL 34.2 13 $1.14

High Mem QXL 68.4 26 $2.28

High CPU Med 1.7 5 $0.19

High CPU XL 7 20 $0.76

Cluster 23 33.5 $1.60

Micro .613 2 (burstable) $0.025

Page 14: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Why SOA on the Cloud?

Page 15: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Cloud Integration

Cloud

Data Centre

JBoss ESB

Data Apps

SAASSalesForce

SAASZen Desk

JBoss JBoss

Page 16: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Cloud Bursting

Cloud

Data Centre

Service Instance

Service Instance

Service Instance

Service Instance

Service Instance

Service Instance

Page 17: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Challenges to Elasticity• Networking

– IP Addresses, Firewalls

• Service Discovery– New Capacity needs to be utilised

• Clustering– New servers must cluster

• Monitoring– Monitoring Tools must discover new servers

• Application Architecture– Elastic Aware

Page 18: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

How to Do Elasticity

• Know Your Scalability

• Know What Limits Scalability

• Measure the Limiting Factors

• Alert on Metrics• Add Additional

Capacity

Users

Cluster Nodes

Page 19: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

JBoss Operations Network(RHQ)

Page 20: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

What is RHQ

The RHQ project is a systems management suite that provides extensible and integrated systems management for multiple products and platforms across a set of core features

such as• monitoring and graphing of values• alerting on error conditions• remote configuration of managed resources• remote operation execution

Page 21: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

RHQ Architecture

RHQ Server

DB

RHQ Agent

RHQ Agent

JBoss Server

RHQ Agent

JBoss Server

Page 22: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

RHQ Agent

• Installed on each machine

• Discovers machine Inventory

• Can access local processes

• Gathers native metrics from the OS.

• Stores metrics during server outage

RHQ AgentPlugin

• Monitoring

• Discovery• Availabilit

y• Schedulin

g• Control

Plugin• Monitorin

g• Discovery• Availabilit

y• Schedulin

g• ControlSIGAR

Native OS Statistics

Page 23: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

RHQ Server

• Stores Data Received From Agents

• Updates Agents• Sends Commands to

Agents• Raises Alerts• Provides Portal• Provides Web Services

and WebDAV interface• Provides CLI Interface• Provides Security

RHQ Server

Database

PortalWeb

ServicesWeb DAV

Content Monitor Alert

Configure Control Inventory

Page 24: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

RHQ and JBoss ESB

• Key Service Metrics– Message Count (Success)– Message Count (Failed)– Processed Bytes

• Key Action Metrics– Processing Time– Message Counts (Average Per Minute)

Page 25: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Key JBoss Metrics

• Key JBoss Metrics– JVM Free Heap– GC Time– Servlet Response Time/ Response Rates– Connection Pool Utilisation

• Key System Metrics– CPU Usage– Network Utilisation

Page 26: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Alerting in RHQ

• Alerts can be set on any metric• Alerts can be set on Availability• Alerts are sent by the Server from filtering the

metric stream• Alert Notification is configurable and

Extensible• Alerts can trigger operations on a resource• Alerts can trigger Script Actions

Page 27: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Alerting and Elasticity

Cloud

Agent

JBoss ESB

RHQ Server

RDS

Message Count

Alert

ec2Client.runInstances

Agent

JBoss ESB

Page 28: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Deploying ESB For Elasticity

Page 29: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Invoking a Service

Service InvocationServiceInvoker invoker = new ServiceInvoker(“Retail”, “ShoeStore”);

Message message = MessageFactory.getInstance().getMessage();

message.getBody().add(“Hi there!”);

invoker.deliverAsync(message);

Page 30: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

JBoss ESB Registry Service

• The registry plays a central role within JBoss ESB for the deployed services – The purpose of the registry is to record services, discover meta-

data and classify entities into pre-defined categories– It may be updated dynamically, when a services first starts or

statically by an external administrator

• The default configuration uses Apache jUDDI v3 as its UDDI registry

• JBoss ESB Registry is based on Apache Scout a JAXR implementation

Page 31: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

JBoss ESB UDDI Browser

Page 32: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Service RegistrationJBoss ESB

JUDDI

Action Pipeline

Action Pipeline

EPRjms://queue:@host1

EPRjms://queue:@host1

JBoss ESB

Action Pipeline

Action Pipeline

EPRjms://queue:@host2

EPRjms://queue:@host2

Page 33: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Service DiscoveryJBoss ESB

Action Pipeline

EPRjms://queue:@host

JBoss ESB

Action Pipeline

EPRjms://queue:@host

ESBClient

JUDDI

Lookup(“Retail”,”ShoeStore”)

Send JMS

Send JMS

Page 34: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Cloud

UDDI on Amazon

JUDDIAmazon RDS

JBoss ESBEmbedded UDDI

JBoss ESBEmbedded UDDI

ESBClient

Elastic Loadbalancer

SOAP

Page 35: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

JMS and Services

• JBoss ESB is JMS Based• Remote Services have JMS Endpoints

– For ESB Aware• Service Invoker retrieves JMS EPR• Service Invoker enqueues Message

Page 36: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

ESB JMS Options

Server 1

JMS DB (Shared)

Server 2

JBoss ESB JBoss ESB

Queue QueueCluster

Clustered JMS

Server 1

JMS DB (Local)

JBoss ESB

Queue

Local JMS

Server 2

JMS DB (Local)

JBoss ESB

Queue

Page 37: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Local JMS Advantages

• Load Balancing Performed by Service Invoker

• Performance Improved• Each Node Stand Alone• No HA Database Required• Use Local MySQL stores• Enables Elasticity

Page 38: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Elastic SOA ArchitectureServer 1

JMS DB (Local)

JBoss ESB

Queue

Server 2

JMS DB (Local)

JBoss ESB

Queue

UDDI (Global, MultiAV RDS)

Server 3

JMS DB (Local)

JBoss ESB

Queue

Server 4

JMS DB (Local)

JBoss ESB

Queue

jms://server1 jms://server2

jms://server3 jms://server4

Page 39: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Service Deployment Options

Page 40: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Service DeploymentHomogenous

Server 1 Server 2 Server 3 Server 4

Service 1

Service 2

Service 1

Service 2

Service 1

Service 2

Service 1

Service 2

Page 41: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Homogenous Deployment

Advantages• Easy Management• Easy Deployment• Simple Scaling• Enables All inVM

Processing• Easier to Test on single

server

Disadvantages• Doesn’t take into account

usage patterns• Can’t Scale Services

Independently• Encourages Monolithic

Deployment• Encourages tight service

coupling

Page 42: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Heterogeneous Deployment

High Compute 1

High C

PU

Service

High Compute 2

High C

PU

Service

High Memory 1

High M

emory S

ervice

High Memory 2

High M

emory S

ervice

High Memory 3

High M

emory S

ervice

Page 43: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Heterogeneous Deployment

Advantages• Each Service can be

independently Tuned• Each Service can be

independently scaled• Services don’t impact

each other• Services can be

independently upgraded• Encourages loose service

coupling

Disadvantages• More Complex

Deployment• More Complex

Management• Development more

complex• Calls are remote across

services

Page 44: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge

Summary

• JBoss ESB’s Architecture Enables Elasticity using IAAS

• JON Alerting can be used to Elastically Scale services

• Centralised UDDI enables Service Discovery across the cloud

• Centralised UDDI Enables Heterogeneous Deployment

Page 45: JUDCon London 2011 - Elastic SOA on the Cloud, Steve Millidge