[osdc.tw 2011] the path to pass into paas -- how we build the solution
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
Copyright 2010 TCloud Computing Inc.
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.
Cloud Computing & Elaster CAP
3Copyright 2010 TCloud Computing Inc.
Shared Workstation
Personal Computer
Hosted Resources
Cloud Computing
The History of Computing
4Copyright 2010 TCloud Computing Inc.
Shared Workstation
Personal Computer
Hosted Resources
Cloud Computing
The History of Computing
5Copyright 2010 TCloud Computing Inc.
Shared Workstation
Personal Computer
Hosted Resources
Cloud Computing
The History of Computing
6Copyright 2010 TCloud Computing Inc.
Shared Workstation
Personal Computer
Hosted Resources
Cloud Computing
The History of Computing
7Copyright 2010 TCloud Computing Inc.
Shared Workstation
Personal Computer
Hosted Resources
Cloud Computing
The History of Computing
8Copyright 2010 TCloud Computing Inc.
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)
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
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
Elaster CAP 1.0
12
Elaster CAP is a Product for public / private / vertical
PaaS operators.
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)
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)
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)
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)
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.
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/
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/
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)
• 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.
How We Build the PaaS Platform?
22
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.
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.
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
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
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
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.
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
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)
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
≈
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.
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»
State Transition
34
INITIALIZING
STOPPED
STARTING
STOPPING
STARTED
DESTROYING
DESTROYED CRASHED
UPDATING
Need
Recovery
Transit from any current state to expected state.
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.
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
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.
Thank You.
38Copyright 2010 TCloud Computing Inc.
Questions?
39Copyright 2010 TCloud Computing Inc.