Running Java EE 6 Applications in the Cloud -...

40
Running your Java EE 6 Applications in the Cloud Arun Gupta Oracle Corporation blogs.sun.com/arungupta, @arungupta

Transcript of Running Java EE 6 Applications in the Cloud -...

Page 1: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

Running your Java EE 6Applications in the Cloud

Arun Gupta

Oracle Corporation

blogs.sun.com/arungupta, @arungupta

Page 2: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

The following/preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Page 3: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

3

AGENDA

> Introduction to Java EE 6> Java EE 6 on Amazon> Java EE 6 on RightScale> Java EE 6 on Elastra> Java EE 6 on Joyent> Conclusions

Page 4: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

4

Brief Introduction to Java EE 6

> Light-weight– Java EE 6 Web Profile, Pruning

> Extensible– Embrace open-source frameworks using web fragments

> Easy-to-use– CDI, Bean Validation, JAX-RS

– JPA 2, JSF 2, Servlets 3, EJB 3.1

– Annotations-based, Optional “web.xml”/”faces-config.xml”, EJB-in-WAR, ...

Page 5: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

5

Java EE 6 Demo

Page 6: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

6

Based uponresearch work ...

Page 7: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

7

What is Amazon ?

> Boot server instances, scale up/down, pay-per-use> EC2: Compute capacity in the cloud> S3: Storage capacity in the cloud (1b → 5 GB)> RRS (reduced redundancy), RDS (database), FWS

(fulfillment), SQS (queue), SNS (notification), CloudWatch (monitoring), FPS (payment), VPC (private cloud), EBS (block storage), ...

Page 8: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

8

Java EE 6 on Amazon

> 2 New AMIs based on Hardened OpenSolaris– Oracle GlassFish Server 3.0 (not released)

– Apache HTTP Server + mod_jk (not released)

– Pre-existing MySQL Database 5.1 AMI

> Instances managed by SMF– GlassFish: svcadm restart/enable/disable

svc:/application/GlassFish/domain1:default

– MySQL SMF: svcadm enable mysql

– mod_jk: svcadm restart/refresh/enable/disable svc:/network/http:apache22

Page 9: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

9

Java EE 6 on Amazon# Define a load-balancing worker worker.list=worker1 ## Define an ajp13 worker to represent instance1 worker.instance1.type=ajp13 worker.instance1.host=ec2-67-202-51-223.compute-1.amazonaws.com worker.instance1.port=8009 ## Define an ajp13 worker to represent instance2 worker.instance2.type=ajp13 worker.instance2.host=ec2-67-202-7-236.compute-1.amazonaws.com worker.instance2.port=8009 ## Define the type of worker1 worker.worker1.type=lb # Add inst1 and inst2 to the balance_workers property of worker1 worker.worker1.balance_workers=instance1,instance2

AJP_INSTANCE_NAMEin GlassFish instances

Page 10: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

10

Java EE 6 on Amazon

mod_jk

GlassFish-1 GlassFish-2

MySQL

GlassFish-N. . .

ManagedUsing

“cladmin”

Page 11: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

11

How to Deploy ?

> Launch MySQL AMI, create database, user, privileges, …

> Launch 1 or more GlassFish AMI– Set AJP_INSTANCE_NAME in each GlassFish

> Administer multiple instances using cladmin– --target instance-list OR set AS_TARGET=”...”

– cladmin create-jdbc-connection-pool …

– cladmin deploy ~/samples/hello.war

> Launch mod_jk AMI– Configure “worker.properties”

Page 12: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

12

Page 13: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

13

20,000surveys/hr

GlassFish 3.0.1 JAX-RS EJB 3.1 JPA 2

Page 14: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

14

Pricing

http://aws.amazon.com/ec2/pricing/

Page 15: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

15

What is RightScale ?

> SaaS to manage servers in multiple IaaS> Automates everything that keeps operations busy

– Provides a library of pre-configured assets

– Design: Cloud-Ready ServerTemplates

– Deploy: Group of Servers, Macros

– Full Automation: Autoscaling, Active monitoring based on real-time triggers, Configuration, Macros, …

– Best practices

> Professional Services

Page 16: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

16

RightS

cale

AmazonUS East

AmazonUS West

AmazonEU

AmazonAsia Rackspace IBM

Cloud VMWare

Cloud-ReadyS olutions

Expertise& S upport

Web Site

Grid Right

Scripts

CloudApplications

AutomationArchitecture

Page 17: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

17

How to Deploy ?Macro Definition

> Launches a new virtual server with clean install of Ubuntu

> Install GlassFish Server Open Source Edition 3.0> Detects database in the deployment

– Installs MySQL Connector/J Driver

– Creates a JDBC Connection Pool and Resource

> Install samples– Archives (WAR/EAR/...) stored in S3

Page 18: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

18

High Availability DeploymentDNS Round Robin

Amazon S3

Load Balancer-1 Load Balancer-2

GlassFish-1 GlassFish-2 GlassFish-3 GlassFish-n. . .

MasterDB

SlaveDB EBS

VolEBSVol

replication

Amazon EC2

Min: 0;Max: 5

Server Array

Page 19: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

19

RightScripts

Page 20: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

20

Alerts

Page 21: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

21

Page 22: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

22

Pricing

http://www.rightscale.com/products/plans-pricing/

Page 23: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

23

What is Elastra ?

> Design, deploy, manage system designs on private/public clouds– Component: A piece of software such as GlassFish or Apache

– Connectors: Enables components to communicate

– Resources: Network storage

> Manage a hybrid cloud (Design → Deployment(s))– VMWare vCenter 2.5, VMWare vSphere4, AWS

> Enterprise Cloud Server (ECS) or AWS Edition

Page 24: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

24

Page 25: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

25

GlassFish Properties

Page 26: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

26

Resource Allocation

Page 27: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

27

Mapping to Amazon Instances

Page 28: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

28

How to Deploy ?Design → Deployment

Page 29: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

29

UninstalledInstallingInstalled

ConfiguringConfigured

StartingStarted

Page 30: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

30

How to Deploy ?Deploying Your App

> Web-based Admin Console to deploy/manage application on GlassFish

> MySQL GUI Tool

Page 31: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

31

Pricing

> Not publicly listed on website– 24 x 7 support

– Unlimited support tickets

– 2-hour guaranteed response time

– Dedicated support engineer

– Forums

– . . .

Page 32: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

32

What is Joyent ?

> High-performance and reliable public, private, and hybrid cloud

> Environment– Development Language: Java, PHP, Ruby, …

– Server: GlassFish, Apache, Nginx, …

– Database: MySQL, Oracle, …

Page 33: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

33

Vs Amazon

Page 34: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

34

How to Deploy ?

> Smart Machine (nee Accelerators)– Public IP Address

– Root access to Solaris Zone

– Guaranteed minimum CPU/RAM

– Dedicated IP address + 100 Mbps connectivity

– Common packages like MySQL can be installed using Webmin

– “sftp” to upload application packages

> Well-trained operations and systems staff

Page 35: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

35

Page 36: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

36

Page 37: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

37

Sample Deployment

> http://fhm8e4fz.joyent.us:8080/

Page 38: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

38

Pricing

> Included support issues– Inaccessible smart machine

– Slow performance

– System-level functionality not working

> $199/incident (max one hour)

http://www.joyent.com/support/support-programs/

Page 39: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

39

Conclusions

> Java EE 6 is light-weight, flexible, easy-to-use> GlassFish Server Open Source Edition 3.0 and

Oracle GlassFish Server 3.0 provides feature-rich implementation

> Java EE 6 applications can be easily deployed on Amazon, RightScale, Elastra, Joyent, and other clouds

Page 40: Running Java EE 6 Applications in the Cloud - VUuosis.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/QualityCharacteristics...The following/preceding is intended to outline

Arun Gupta blogs.sun.com/arungupta

Oracle Corporation [email protected]