[osdc.tw 2011] the path to pass into paas -- how we build the solution

39
Copyright 2010 TCloud Computing Inc. The Path to Pass into PaaS How We Build the Solution

Upload: jeff-hung

Post on 10-May-2015

2.247 views

Category:

Technology


1 download

DESCRIPTION

Elaster CAP is a Platform-as-a-Service (PaaS) solution that enable any developer or service provider to host their own PaaS cloud. So they can focus on application logic and Elaster CAP will help to reduce operation cost. Elaster CAP supports Java Web Applications and Hadoop Map/Reduce Applications. It also provides many cloud-based infrastructures to support your Software-as-a-Service applications, such as Relational Database, Index/Search service, and Big-data Storage with S3 compatible adapter. Elaster CAP is designed to be elastic that, depends on the use cases, the cloud can be as small as one node, or as big as more than hundreds of nodes. The nodes in Elaster CAP can run on physical machines in your data center, or virtual machines hosted by Infrastructure-as-a-Service (IaaS) providers such as EC2 and TCloud Elaster. In this talk, We'd like to describe the technology and strategy we took when building Elaster CAP. And share the pitfalls and gotchas that we experienced during the journey.

TRANSCRIPT

Page 1: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Copyright 2010 TCloud Computing Inc.

The Path to Pass into PaaS

How We Build the Solution

Page 2: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

The Speaker

• Jeff Hung

– A Bloggerwww.jeffhung.net/blog

– Identity on the Net@jeffhung

– Developer of Trend [email protected]

Copyright 2010 TCloud Computing Inc.

Page 3: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Cloud Computing & Elaster CAP

3Copyright 2010 TCloud Computing Inc.

Page 4: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Shared Workstation

Personal Computer

Hosted Resources

Cloud Computing

The History of Computing

4Copyright 2010 TCloud Computing Inc.

Page 5: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Shared Workstation

Personal Computer

Hosted Resources

Cloud Computing

The History of Computing

5Copyright 2010 TCloud Computing Inc.

Page 6: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Shared Workstation

Personal Computer

Hosted Resources

Cloud Computing

The History of Computing

6Copyright 2010 TCloud Computing Inc.

Page 7: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Shared Workstation

Personal Computer

Hosted Resources

Cloud Computing

The History of Computing

7Copyright 2010 TCloud Computing Inc.

Page 8: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Shared Workstation

Personal Computer

Hosted Resources

Cloud Computing

The History of Computing

8Copyright 2010 TCloud Computing Inc.

Page 9: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

9

• E-Commerce

• CRM / Supply Chain

• Knowledge Mgt.

• Communication

Software-as-a-Service (SaaS)

• Web Services

• Components

• Big-Data Processing

Platform-as-a-Service (PaaS)

• Network

• Compute

• Storage

• Virtualization

Infrastructure-as-a-Service (IaaS)

Page 10: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

10

• E-Commerce

• CRM / Supply Chain

• Knowledge Mgt.

• Communication

Software-as-a-Service (SaaS)

• Web Services

• Components

• Big-Data Processing

Platform-as-a-Service (PaaS)

• Network

• Compute

• Storage

• Virtualization

Infrastructure-as-a-Service (IaaS)

Val

ue

Nea

r to

En

d U

ser

Mr. User

Page 11: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

11

• E-Commerce

• CRM / Supply Chain

• Knowledge Mgt.

• Communication

Software-as-a-Service (SaaS)

• Web Services

• Components

• Big-Data Processing

Platform-as-a-Service (PaaS)

• Network

• Compute

• Storage

• Virtualization

Infrastructure-as-a-Service (IaaS)

Val

ue

Nea

r to

En

d U

ser

Mr. User

Mo

re like a Cap

ital Gam

e

Page 12: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Elaster CAP 1.0

12

Elaster CAP is a Product for public / private / vertical

PaaS operators.

Page 13: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Elaster CAP 1.0

13

Elaster CAP is a Product for public / private / vertical

PaaS operators.

MassiveCompute

Elaster Cloud Application Platform API

Dynamic Workload Distribution & Optimization

Scalability & Availability

Development Deployment

Publish Management

Big Data

SaaS 2

SaaS 1

SaaS 3

SaaS 4

SaaS 5

SaaS 6

SaaS 7

UnpredictablePeak

Workloads

TCloud Elaster CAP

(Cloud Application Platform)

Page 14: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Elaster CAP 1.0

14

Elaster CAP is a Product for public / private / vertical

PaaS operators.

TCloud

Computing

Sale

MassiveCompute

Elaster Cloud Application Platform API

Dynamic Workload Distribution & Optimization

Scalability & Availability

Development Deployment

Publish Management

Big Data

SaaS 2

SaaS 1

SaaS 3

SaaS 4

SaaS 5

SaaS 6

SaaS 7

UnpredictablePeak

Workloads

TCloud Elaster CAP

(Cloud Application Platform)

Page 15: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Elaster CAP 1.0

15

Elaster CAP is a Product for public / private / vertical

PaaS operators.

TCloud

Computing

Sale

Cloud Service

OperatorProvide

MassiveCompute

Elaster Cloud Application Platform API

Dynamic Workload Distribution & Optimization

Scalability & Availability

Development Deployment

Publish Management

Big Data

SaaS 2

SaaS 1

SaaS 3

SaaS 4

SaaS 5

SaaS 6

SaaS 7

UnpredictablePeak

Workloads

TCloud Elaster CAP

(Cloud Application Platform)

Page 16: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Elaster CAP 1.0

16

Elaster CAP is a Product for public / private / vertical

PaaS operators.

TCloud

Computing

Sale

Cloud Service

OperatorProvide

Developer

or Startups

Run

MassiveCompute

Elaster Cloud Application Platform API

Dynamic Workload Distribution & Optimization

Scalability & Availability

Development Deployment

Publish Management

Big Data

SaaS 2

SaaS 1

SaaS 3

SaaS 4

SaaS 5

SaaS 6

SaaS 7

UnpredictablePeak

Workloads

TCloud Elaster CAP

(Cloud Application Platform)

Page 17: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Elaster CAP Philosophy

• Minimum change of skill-set of developer

Developers don’t need to learn new skill for developing or porting their applications runon top of Elaster CAP

• Cloud-based infrastructure in a box

native high-scalability, high-availability,and load-balancing in system design

17Copyright 2010 TCloud Computing Inc.

Page 18: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

PaaS Personalities

• Application Development Platform

– Radically embracing cloud computing

– Force.com, Microsoft Azure, Google AppEngine, Heroku

• Application Management Platform

– Enable existing on-premise frameworks

– RightScale, Makara

• Data Processing Platform

– Specialized purpose-driven

– Amazon Map/Reduce, PingIdentity, Akamai

18http://www.prudentcloud.com/cloud-computing-technology/multiple-personalities-of-platform-as-a-service-18102010/

Page 19: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

PaaS Personalities

• Application Management Platform

– Enable existing on-premise frameworks

– RightScale, Makara

– And… Elaster CAP

19http://www.prudentcloud.com/cloud-computing-technology/multiple-personalities-of-platform-as-a-service-18102010/

Page 20: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Copyright 2010 TCloud Computing Inc. 20

• Runtime Services:– JSP (2.1) / Servlet (2.5) / J2SE 5 or Java SE 6

– PHP (5.3)

– Hadoop Map/Reduce (0.20.2)

• Resource Services:– RDB (MySQL 5.1)

– Search Engine

– Big Data Storage(Like Amazon S3)

Page 21: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

• Free PaaS Playground

– Enabled by Elaster CAP

– Hosted by TCloud.

• Elaster CAP Official Site

– Download Center

– Document Center

• Tech Support Forum

• Launched in Jan, 2011: www.elasterlabs.com.tw

21Copyright 2010 TCloud Computing Inc.

Page 22: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

How We Build the PaaS Platform?

22

Page 23: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

The Technical Problems

• Hundreds or thousands of machines

• Each with tens or hundreds of instances

• Instances should be paired or clustered together,for HA and Balancing

• Dispatch network traffics to correct back-end

• Plan to deliver various cloud services,from time to time

• Eventually, we still have to face the problem:How do we optimize it?

23Copyright 2010 TCloud Computing Inc.

Page 24: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

The Realistic Problems

• We won’t really operate it.

• Customer don’t know how to operate it.

• Developer want silver bullet, maybe.

• Who’s gonna buy it?

• How will it sale?

24Copyright 2010 TCloud Computing Inc.

Page 25: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

That’s Simplify the Problem

• Static configurable feature set

– Define enabled services when bootstrapping

– Same static configurations everywhere

• No online upgrade

– dynamically wired

– incrementally deployed and tested

• Believe some fallacies

– FQDN and flat L3 environment

• Homogenous topology, sort of

– No provisioning

– Install everything, launch by needs25

Page 26: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Scale from 1 to N

Master Node

HadoopNameNode

HbaseMaster

ZooKeeper

LDAP Server

System DB ElasterCAP Composite Server

API Server

Resource Host

HadoopData Node

Load Balancer

WOE Instance

MySQLDatabase

Java Web Container

HbaseRegion Server

AMP Server

Fedora 12 x64

Page 27: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Scale from 1 to N

Master Node

HadoopNameNode

HbaseMaster

ZooKeeper

LDAP Server

System DB ElasterCAP Composite Server

API Server

Resource Host

HadoopData Node

Load Balancer

WOE Instance

MySQLDatabase

Java Web Container

HbaseRegion Server

AMP Server

Fedora 12 x64

Worker Node * N

ElasterCAP Composite Server

API Server

Resource Host

HadoopData Node

Load Balancer

WOE Instance

MySQLDatabase

Java Web Container

HbaseRegion Server

AMP Server

Fedora 12 x64

Page 28: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Network Configurations

• Recognize 2 network segments:

– The Public Network –Accepting Web Traffics from Internet.

– The Private Network – Inter-communicate between nodes.

– These 2 network segments can be the same one.

• Use wildcard DNS as 1st tier load balancing

– www.elasterlabs.com.tw

– api.elasterlabs.com.tw

– *.app.elasterlabs.com.tw

– *.s3.elasterlabs.com.tw

28Copyright 2010 TCloud Computing Inc.

All point to multiple IP addresses

configured as the public network.

The 2nd tier load balancers are

waiting there to dispatch requests

to backend application servers.

Page 29: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Copyright 2010 TCloud Computing Inc. 29

MySQL DatabaseMySQL

DatabaseMySQL

DatabaseMySQL

Database

Java Web ContainerJava Web ContainerJava Web ContainerJava Web Container

HadoopHBase

HadoopHBase

HadoopHBase

HadoopHBase

LuceneIndexer

LuceneIndexer

LuceneIndexerSearch Engine

Elaster CAP Service (API Server)

Elaster CAP Service (API Server)

Elaster CAP Service (API Server)

Elaster CAP Service (API Server)

api.elasterlabs.com.tw

*.app.elasterlabs.com.tw

Internet

Balancer

Manage

Page 30: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Copyright 2010 TCloud Computing Inc. 30

MySQL DatabaseMySQL

DatabaseMySQL

DatabaseMySQL

Database

Java Web ContainerJava Web ContainerJava Web ContainerJava Web Container

HadoopHBase

HadoopHBase

HadoopHBase

HadoopHBase

LuceneIndexer

LuceneIndexer

LuceneIndexerSearch Engine

Elaster CAP Service (API Server)

Elaster CAP Service (API Server)

Elaster CAP Service (API Server)

Elaster CAP Service (API Server)

api.elasterlabs.com.tw

*.app.elasterlabs.com.tw

Internet

Balancer

Manage

Driven by Workload

Optimization Engine

(WOE)

Page 31: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Fedora 12 x86 on Physical/Virtual MachineFedora 12 x86 on Physical/Virtual Machine

Resource Host vs. Guest Instances

31

Fedora 12 x86 on Physical/Virtual Machine

CompositeServer (JVM)

Resource Host

MySQLGuest Instance

JettyGuest Instance

NginxGuest Instance

Jetty Container (JVM)

Nginx Balancer(Daemon)

MySQL Server(Daemon)

WOE

API Server

Page 32: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

32

Coordination Service(ZooKeeper)

WOE

API Server

1: Where is WOE?

2: Hey, I need a Jetty.

0: Hosted in all nodes, only leader activate.

3: Locate hosting based on global knowledge.

4: Oh, I’m expected to run a Jetty.

5: I’m currently running a Jetty.

Page 33: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Cloud Entity and Expected/Current State

33Copyright 2010 TCloud Computing Inc.

WOE

Cloud Entity

/

resourcehosts

0ea40b00...5c3f4c436e7b

expected

current

JAVA_WEB_CONTAINER

8e1bb5f1...766787dd7540

expected

current

Resource Host Guest Instance

JettyGuest Instance

MySQLGuest Instance

NginxGuest Instance

(ephemeral)

DATABASE«realize»

Page 34: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

State Transition

34

INITIALIZING

STOPPED

STARTING

STOPPING

STARTED

DESTROYING

DESTROYED CRASHED

UPDATING

Need

Recovery

Transit from any current state to expected state.

Page 35: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Why not RPC or MQ?

• RPC doesn’t scale. Consider locating best hosting.

• MQ can’t remember, and can’t be tracked.

• Communicate via Whiteboard using ZooKeeper

– Strict ordering

– Event notification

– Asynchronous

– Global Knowledge

35Copyright 2010 TCloud Computing Inc.

Page 36: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Workload Optimization Engine (WOE)

Operating System (Linux Fedora 12)

Infrastructure Service (virtual machine or physical machine)

Ap

plicatio

n

Man

agem

en

tP

ortal

Application IDE (Integrated development environment)Syste

m

Ad

min

istration

C

LI

Application Management API

Elaster CAP SDK

Big-Data Storage

Relational DB (MySQL)Search Engine

MapReduce

Other…

Elaster CAP API

Web Container

Ap

p R

un

tim

e

Reso

urc

e H

ost

Servlet Container

M/R Jobs HTML JSP

Page 37: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Elaster Labs – Current Status

• 5+ virtual machines

• 13x Running Applications

• Just released Elaster CAP 1.0.1.1025

– Download from www.elasterlabs.com.tw

– VM Image Distribution

• Platform of TM Programming Contest 2011

• We appreciate your comments.

37Copyright 2010 TCloud Computing Inc.

Page 38: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Thank You.

38Copyright 2010 TCloud Computing Inc.

Page 39: [OSDC.tw 2011] The Path to Pass into PaaS -- How We Build the Solution

Questions?

39Copyright 2010 TCloud Computing Inc.