auto-scaling axis2 web services on amazon ec2 by afkham azeez

43
Auto-scaling Axis2 Web Services on Amazon EC2 By Afkham Azeez

Upload: cambree-jones

Post on 02-Jan-2016

26 views

Category:

Documents


4 download

DESCRIPTION

Auto-scaling Axis2 Web Services on Amazon EC2 By Afkham Azeez. The Problem A Solution Some Concepts Design & Implementation Details. Overview. Fault tolerance, high availability & scalability are essential prerequisites for any enterprise application deployment - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

Auto-scaling Axis2 Web Services on

Amazon EC2

ByAfkham Azeez

Page 2: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

2

Overview

• The Problem

• A Solution

• Some Concepts

• Design & Implementation Details

Page 3: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

3

The Problem

• Fault tolerance, high availability & scalability are essential prerequisites for any enterprise application deployment

• One of the major concerns is avoiding single points of failure

• There is a high cost associated with achieving high availability & scalability.

Page 4: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

4

Solutions

• Traditional solution

– Buying safety-net capacity

• Better solution

– Scale-up the system when the load increases

– Scale-down the system when the load decreases

– Should not have idling nodes

– Virtualization

– Pay only for the actual computing power & bandwidth utilized

Page 5: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

5

Project Objective

• Building a framework which will auto-scale the number of Axis2 nodes on Amazon EC2, depending on the load

• This is a PoC Project

Page 6: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

6

Amazon EC2

Amazon EC2 provides resizable compute capacity in the cloud

Provides a simple Web service interface & tooling that allows one to obtain and configure capacity with ease & to build failure resilient applications

Page 7: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

7

Apache Axis2

Axis2 is a middleware platform which enables hosting of Web service applications and supports some of the major Web services standards

Can host Web services written in Java as well as various scripting languages

Can be deployed in a clustered configuration Uses Apache Tribes for clustering Axis2 clustering can be adopted to work on EC2

Page 8: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

8

Apache Synapse

Apache Synapse is designed to be a simple, lightweight and high performance ESB

Supports load balancing with or without failover Supports static & dynamic load balancing Uses Apache Axis2

Page 9: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

9

Apache Tribes

A messaging framework with group communication abilities

Allows you to send and receive messages over a network, it also allows for dynamic discovery of other nodes in the network.

Used by Apache Tomcat & Apache Axis2

Page 10: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

10

Deploying a Service on the Cloud

AMI Instances

Page 11: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

11

Deploying a Service on the Cloud

Page 12: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

12

Deploying a Service on the Cloud

Page 13: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

13

Deploying a Service on the Cloud

Service is available now

Page 14: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

14

Auto-scaling

Page 15: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

15

Auto-scaling

Load Increases

Page 16: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

16

Auto-scaling

Startup new instances

Page 17: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

17

Auto-scaling

New instances join group

Page 18: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

18

Auto-scaling

Load Decreases

Page 19: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

19

Auto-scaling

Terminate instances

Page 20: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

20

Auto-scaling

Terminate instances

Page 21: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

21

Deployment Architecture

Page 22: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

22

Membership Aware Dynamic Load Balancing (1/2)

Page 23: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

23

Membership Aware Dynamic Load Balancing (2/2)

Page 24: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

24

Membership Schemes

Static Dynamic Hybrid (WKA based)

Page 25: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

25

WKA Based Membership (1/3)

Application member joins. The load balancer is also a well-known member

Page 26: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

26

WKA Based Membership (2/3)

A non-WK load balancer joins

Page 27: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

27

WKA Based Membership (3/3)

A well-known load balancer rejoins after crashing

Page 28: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

28

Membership Channel Architecture

Page 29: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

29

Initialization Channel Architecture

Page 30: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

30

Synapse Configuration - axis2.xml

Page 31: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

31

Synapse Configuration - synapse.xml

Page 32: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

32

Synapse Configuration

• AutoscaleInMediator

• AutoscaleOutMediator

• Autoscale Task

Page 33: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

33

Synapse Configuration

AutoscaleInMediator

AutoscaleOutMediator

MessageID List LoadAnalyzerTask

SendMediator DynamicLoadbalanceEndpoint

SendMediator

EC2 Client

SynapseSynapse

From client

To client

To Axis2

From Axis2

To EC2 WS

Get length Invoke

IN

OUT

Normal Flow

Page 34: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

34

Synapse Configuration

AutoscaleInMediator

AutoscaleOutMediator

MessageID ListLoadAnalyzer

Task

SendMediator DynamicLoadbalanceEndpoint

MakeFaultMediator

EC2 Client

SynapseSynapse

From client

Toclient

To Axis2

From Axis2

To EC2 WS

Get length Invoke

IN

ErrorHandlerSendMediator

Fault Flow

Page 35: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

35

Synapse Autoscale Task

Page 36: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

36

Axis2 Configuration - axis2.xml

Page 37: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

37

Synapse Autoscale Task

• Sanity Check

• Autoscaling– Scale up– Scale down

Page 38: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

38

Implementation Details• Single AMI – autoscalews

• Start– ec2-run-instances ami-a03fdbc9 -k autoscale -f payload.zip -g

autoscale-lb

• Payload

– Extract params from payload

– Env variables

• Axis2 & Synapse Configuration files & Repositories

– Maintained on S3

• Fault Tolerance

– Monitoring cron job

– Java Service Wrapper daemons

– Future: Use monit

– Future: Axis2/Synapse agent to check process status

Page 39: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

39

Implementation Details

Start

Start

Start

StartInitial Instance

LB Group Axis2 App Group

synapse.xml

S3 Bucket

Load configuration

Page 40: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

40

Implementation Details

Repo

Conf

Axis2 Instance

S3 Bucket

Load repo

Load configuration

Page 41: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

41

TODO

RightScale comparison

Google App Engine comparison

Eucalyptus AppScale

Perf figures

Page 42: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

42

Questions

Suggestions

Improvements

Page 43: Auto-scaling Axis2 Web Services  on  Amazon EC2 By Afkham Azeez

43

Thank You