Amazon Elastic Beanstalk

39
Eberhard Wolff Freelance Consultant/ Trainer Head Technology Advisory Board adesso AG Amazon Elastic Beanstalk

description

 

Transcript of Amazon Elastic Beanstalk

Page 1: Amazon Elastic Beanstalk

Eberhard Wolff

Freelance Consultant/ Trainer Head Technology Advisory Board

adesso AG

Amazon Elastic Beanstalk

Page 2: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

HISTORY & ORIGIN

Page 3: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

History & Origin ! Amazon: cloud pioneer ! Original offerings ! EC2 Elastic Compute Cloud ! S3 Simple Storage Service ! Many other offerings ! E.g. databases, Map / Reduce … ! Foundation for many other services

Page 4: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Other Amazon Services ! Elastic Load Balancer

! Auto Scaling starts new EC2 instances

! EBS: Elastic Block Storage virtual hard disks

Page 5: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Elastic Beanstalk in a Nutshell

Page 6: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Elastic Beanstalk in a Nutshell

!  EC2 Server !  +Linux !  +OpenJDK !  +Tomcat !  Scaling Elastic

Load Balancer / Auto Scaling

!  Deploy artefacts on S3

!  Can add database (RDS) S3

WAR

EC2 ServerLinux

OpenJDK Tomcat

Elastic Load BalancerAuto Scaling

EC2 ServerLinux

OpenJDK Tomcat

...

Page 7: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Programming Model ! OpenJDK + Tomcat

! Standard Java Programming Model

! Also supported: Python, PHP, Ruby, Node.js (Linux), .NET (Windows Server 2008R2)

Page 8: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Scaling / High Availability ! Servers automatically started ! Auto Scaling

! Failed servers will be restarted ! Servers can run in several data

centers

Page 9: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

TOOLS

Page 10: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Web Console ! Web UI

! Wizard to create new application ! + environment to run the application

on

Page 11: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

DEMO: NEWS APPLICATION

Page 12: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

News Application

Page 13: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

News Application Originally by Bernhard Löwenstein

Page 14: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

News Application

✔ ✔ (✔)

Page 15: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

News Application ✖ ✔ ✔

Spring

Page 16: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

News Application

Next slide

Page 17: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Code Changes Took the Spring application Converted to MySQL <bean class="java.net.URI" id="dbUrl"> <constructor-arg value="#{systemEnvironment['JDBC_CONNECTION_STRING']}" /></bean><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="url" value="#{ 'jdbc:mysql://' + @dbUrl.getHost() + " ':' + @dbUrl.getPort() + @dbUrl.getPath() }" /> <property name="username" value="#{ @dbUrl.getUserInfo().split(':')[0] }" /> <property name="password" value="#{ @dbUrl.getUserInfo().split(':')[1] }" /></bean>

Page 18: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 19: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 20: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 21: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 22: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 23: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 24: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 25: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 26: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 27: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Page 28: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Some tricks... ! Easy to create a new environment

! E.g. for testing, staging

! URLs can be swapped

Page 29: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Some tricks... ! Deploy new version on new

environment

! Switch URLs with production

! Zero downtime

Page 30: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

More tools ! All web console action also possible

using SOAP Web Services

! Command Line tools

Page 31: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Eclipse Plug In ! Manage all AWS resources (EC2,

S3…)

! Manage Elastic Beanstalk server just like local servers

Page 32: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Eclipse Plug In

Page 33: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

FLEXIBILITY

Page 34: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Flexibility ! Tuning possible ! E.g. JVM parameters ! Load balancer configuration ! Can even use your own system images !  i.e. can add software, fine tune … ! Can log into running servers ! Session handling can be tuned ! Use EC2 if Elastic Beanstalk not flexible

enough

Page 35: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Configuration Files ! Part of the deployable artifact ! Declaratively install packages &

libraries ! Configure software components ! Run commands ! Set environment variables ! Create users & groups

Page 36: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

PLATFORM AND OTHER SERVICES

Page 37: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Platform ! Amazon Web Services ! Proven foundation ! Used for many other cloud plattforms ! …and by many users !  Includes monitoring ! No additional charges to EC2 / S3 ! Free tier (750 h/month for one year)

available

Page 38: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Other Services ! Amazon Relational Database Service ! Oracle, MySQL, MS SQL Server ! Diverse NoSQL solutions

(e.g. DynamoDB, SimpleDB) ! Lots of AWS services (Map/Reduce,

Caches, Search etc) ! Other services provided by 3rd parties

Page 39: Amazon Elastic Beanstalk

Eberhard Wolff - @ewolff

Amazon Elastic Beanstalk: Highlights

! Proven foundation ! Standard Java stack (Tomcat +

OpenJDK) ! World wide availability (incl.

Europe) ! Lots of additional services