SlideShare a Scribd company logo
1 of 67
Download to read offline
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




               Running Java applications
               on the Amazon Elastic
               Compute Cloud
                            Chris Richardson
                        Author of POJOs in Action
                         Founder of Cloud Tools
                        www.chrisrichardson.net




Chris Richardson – Running Java applications on Amazon EC2                              Slide 1
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Overall presentation goal

             Show how to use
      Amazon Elastic Compute Cloud
    for developing and deploying Java
                applications




Chris Richardson — Running Java applications on Amazon EC2                              Slide 2
Colorado Software Summit: October 19 – 24, 2008                                               © Copyright 2008, Chris Richardson




                About Chris
                                                             Grew up in England and live in Oakland, CA
                                                                    p     g                        ,
                                                             Over twenty years of software development
                                                             experience
                                                                 Building object-oriented software since 1986
                                                                 Using Java since 1996
                                                                 Using J2EE since 1999
                                                             Author of POJOs in Action
                                                             Speaker at JavaOne, SpringOne, NFJS, JavaPolis,
                                                             Spring Experience, etc.
                                                             Chair of the eBIG Java SIG in Oakland
                                                             (www.ebig.org)
                                                             (www ebig org)
                                                             Run a consulting and training company that helps
                                                             organizations build better software faster and
                                                             deploy it on Amazon EC2
                                                             Founder of Cloud Tools, an open-source project
                                                             for d l i
                                                             f deploying J Java applications on Amazon EC2:
                                                                                    li ti       A        EC2
                                                             http://code.google.com/p/cloudtools




Chris Richardson — Running Java applications on Amazon EC2                                                               Slide 3
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Agenda
       Cloud computing with Amazon EC2
       Using Amazon EC2
       Overview of Cloud Tools
       Developing on Amazon EC2
       Deploying on Amazon EC2
       A few thoughts about Groovy



Chris Richardson — Running Java applications on Amazon EC2                              Slide 4
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Computing
                Comp ting has come a long way
                                           a                                        Present
                                 Past




                         www.computermuseum.org.uk

                                                                         www.dell.com




                    Yet we rarely have enough


Chris Richardson — Running Java applications on Amazon EC2                              Slide 5
Colorado Software Summit: October 19 – 24, 2008                       © Copyright 2008, Chris Richardson




                Cloud computing


                                A pool of highly scalable, abstracted
                                   infrastructure that hosts your
                                    application, and is billed by
                                            consumption
                                                    p




                                                               By James Staten of Forrester Research




Chris Richardson — Running Java applications on Amazon EC2                                       Slide 6
Colorado Software Summit: October 19 – 24, 2008                    © Copyright 2008, Chris Richardson




                Power generation
                    Past                                     Present




Chris Richardson — Running Java applications on Amazon EC2                                    Slide 7
Colorado Software Summit: October 19 – 24, 2008                       © Copyright 2008, Chris Richardson




                Amazon-Style Cloud Computing
                Ama on St le Clo d Comp ting
       Elastic Compute Cloud (EC2)
              On-demand computing
       Elastic Block Storage (EBS)
              quot;SAN on demandquot;
               SAN    demand
       Simple Storage Service (S3)
              Stores blobs of data
       Si
       Simple Queue S
           l Q      Service (SQS)
                        i
              Hosted queue-based messaging system
       SimpleDB
              Store data sets                                   Pay per use
              Execute queries                                services managed
                                                                by Amazon

Chris Richardson — Running Java applications on Amazon EC2                                       Slide 8
Colorado Software Summit: October 19 – 24, 2008                    © Copyright 2008, Chris Richardson




                What is Amazon EC2?
            Virtualized computing environment
            S       i               d h
            Server instances managed through a web service API
                                            h     b      i
            IP addresses and host names assigned dynamically
            Pay by the hour ($0.10-0.80/hour) + external bandwidth
            ($0 10-0 18/Gbyte)
            ($0.10 0.18/Gbyte)

https://ec2.amazonaws.com/?Action=RunInstances               <RunInstancesResponse>
 &ImageId=ami-398438493                                      …
 &MaxCount=3                                                 </RunInstancesResponse>
 &MinCount=3


cer@arrakis ~
          k
$ ssh … root@ec2-67-202-41-150.compute-1.amazonaws.com
Last login: Sun Dec 30 18:54:43 2007 from 71.131.29.181
[root@domU-12-31-36-00-38-23:~]



Chris Richardson — Running Java applications on Amazon EC2                                    Slide 9
Colorado Software Summit: October 19 – 24, 2008                                                       © Copyright 2008, Chris Richardson




                Instance types
                          Virtual                 Compute
                                                      p            32//         Memory
                                                                                     y              Storage $/hr
                                                                                                         g  $/
                          Cores                   Units            64
                                                  /core*           Bit
     Small                1                       1                32 bit       1.7G                160G                0.10
     High-                2                       2.5              32 bit       1.7G                350G                0.20
     CPU
     Medium
     Large                2                       2                64 bit       7.5G                850G                0.40
     Extra                4                       2                64 bit       15G                 1690G               0.80
     Large
     High-                8                       2.5              64 bit       7G                  1690G               0.80
     CPU XL

                                          * EC2 Compute Unit = 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor




Chris Richardson — Running Java applications on Amazon EC2                                                                      Slide 10
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Operating systems
       Use Amazon provided Machine Image (AMI)
              32-bit
              32 bit Fedora Core 4
              64-bit Fedora Core 6
       Many 3rd parties have public AMIs
              Various Linux distributions
              E.g. Redhat, RightScale
       Sun provides OpenSolaris
       Windows is in beta:
              Windows Server 2003 ($0.125-$2/hour)
              Optional SQL Server Standard ($1.10-3.20/hour)
       Build your own Linux:
              Install applications starting with someone else's AMI and
              save it
              Create an AMI from scratch


Chris Richardson — Running Java applications on Amazon EC2                             Slide 11
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                One minor thing
                          thing…

                   Terminate your i t
                   T    i t        instance
                              ⇒
                    y
                    your local data is lost.

         Either very good or very bad

Chris Richardson — Running Java applications on Amazon EC2                             Slide 12
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Elastic Block Storage
       Mountable storage volumes
              quot;On-demand SANquot;
              Size: 1 GB to 1 TB
              Mount on a single instance
       Create snapshots
              Stored in S3
              Create new volumes from the snapshot
       Cost:
              $0.10/GByte/month
              $0.10 per 1 million I/O requests


Chris Richardson — Running Java applications on Amazon EC2                             Slide 13
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Elastic IP addresses
       Instance IP addresses are dynamically allocated
       on start up
          start-up
              Does not work well for publicly accessible services,
              e.g. a website
       Elastic IP addresses:
              Statically allocated addresses
              Associated with your account (max. 5)
              Att h d t an i t
              Attached to      instance (
                                        (e.g. public f i
                                                bli facing web
                                                             b
              server)
              You configure DNS to resolve to the elastic IP address
       Pricing:
       P i i
              Non-attached Elastic IP address - $0.01/hour
              $0.10 per remap (if > 100 in a month)


Chris Richardson — Running Java applications on Amazon EC2                             Slide 14
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Regions and a ailabilit zones
                            availability ones
       By default, your database master and slave could run on
       the same physical host!
       Regions:
              Geographically dispersed locations
              Currently only one
       Availability zone:
              Part of a region
              Engineered to be insulated from failure in other zones
       Specify availability zone when launching instances:
              Same zone as other instances for free data transfer
              Different zone for higher-availability
                                   g               y
       SLA with 99.95% region availability
              Instances have external connectivity
              You can launch new instances


Chris Richardson — Running Java applications on Amazon EC2                             Slide 15
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson



                What is the Amazon Simple
                Storage Se ice
                Sto age Service (S3)?
       Flat storage model consisting of buckets and objects
              Bucket – has a name and contains objects
              Objects – has a key, stores 1 byte - 5G
              Object key can look like a path ☺
       Cost:
              $0.15/GB-Month
              $0.10-0.18/GB of data transferred
              $0.00001 $0.000001/Web
              $0.00001-$0.000001/Web Service call
              Data transfers between EC2 and S3 are free of bandwidth
              charges
       Buckets and objects can be:
              Public – accessible by anyone
              Private – accessible to owner, acl member




Chris Richardson — Running Java applications on Amazon EC2                             Slide 16
Colorado Software Summit: October 19 – 24, 2008                        © Copyright 2008, Chris Richardson




                S3 REST API
                        PUT / HTTP/1.1
                                                                        Create a bucket
                        Host: <BucketName>.s3.amazonaws.com
                        Authorization: AWS AWSAccessKeyId:Signature
                        …

                        PUT /<ObjectName> HTTP/1.1
                        Host: <BucketName>.s3.amazonaws.com
                        Authorization: AWS AWSAccessKeyId:Signature     Create an item in a bucket
                        …
                        …Bytes…


                         GET /<ObjectName> HTTP/1.1
                         Host: <BucketName>.s3.amazonaws.com
                                                                        Download an item
                         Authorization: AWS AWSAccessKeyId:Signature
                         …

                        DELETE /<ObjectName> HTTP/1.1
                        Host: <BucketName>.s3.amazonaws.com
                        Authorization: AWS AWSAccessKeyId:Signature    Delete an item
                        …



Chris Richardson — Running Java applications on Amazon EC2                                       Slide 17
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Using EC2 and S3 together
       AMIs are stored in S3
       EC2 instances use S3:
              Use REST API
              Store database snapshots in S3
              Use 3rd party Linux file system that stores
              data in S3
              Store EBS volume snapshots in S3



Chris Richardson — Running Java applications on Amazon EC2                             Slide 18
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                So what does this mean?
       For developers
              Immediate access to many servers
              Simplified setup
              Great for testing
       For deployment
              Eliminates capital expenses
              Reduces risk of success catastrophe
              R d       i k f           t t    h



Chris Richardson — Running Java applications on Amazon EC2                             Slide 19
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Agenda
       Cloud computing with Amazon EC2
       Using Amazon EC2
       Overview of Cloud Tools
       Developing on Amazon EC2
       Deploying on Amazon EC2
       A few thoughts about Groovy



Chris Richardson — Running Java applications on Amazon EC2                             Slide 20
Colorado Software Summit: October 19 – 24, 2008                   © Copyright 2008, Chris Richardson



                Signing up for Amazon Web
                Services
                Se ices

                                                             AWS access
                                                             identifiers:
                                                               Account Id
                                                               Access Id
                                                               Secret key
                                                               Private key and
                                                               certificate
                                                             Only takes a
                                                             few minutes




Chris Richardson — Running Java applications on Amazon EC2                                  Slide 21
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                EC2 API and Tools
       SOAP and Query APIs
              Launch and manage instances etc
       Amazon provided CLI tools
              CLI equivalents of APIs
              AMI creation tools
       AWS CLI tools from Tim Kay
              CLI for S3 and EC2
                  f         d
              Alternatives to Amazon CLI tools
       ElasticFox
         a     o
              Awesome Firefox plugin
              Launch and manage instances


Chris Richardson — Running Java applications on Amazon EC2                             Slide 22
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Using the Query API
       https://ec2.amazonaws.com/?queryparameters...
       Mandatory parameters:
       M d
              Action – what to do
              AWSAccessKeyId – your access id
              Version – API version
              Timestamp – when request was made
              Expires – when it expires
              Signature – digest of parameters and secret key
              SignatureVersion – set to 1
       Other parameters depend on Action
       Returns an XML document


Chris Richardson — Running Java applications on Amazon EC2                             Slide 23
Colorado Software Summit: October 19 – 24, 2008                               © Copyright 2008, Chris Richardson




                Example EC2 requests
   Action                                                    Parameters
   RunInstances                                              MinCount, MaxCount, ImageId,
                                                             InstanceType, …
   TerminateInstances                                        InstanceId.n
                                                             InstanceId n
   DescribeInstances                                         InstanceId.n
   CreateSecurityGroup                                       GroupName, GroupDescription
   AuthorizeSecurityGroupIngress                             GroupName,
                                                             SourceSecurityGroupName,
                                                             IpProtocol
   DeauthorizeSecurityGroupIngress
        h     S       G                                      …
   …




Chris Richardson — Running Java applications on Amazon EC2                                              Slide 24
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson



                aws - simple access to EC2 and
                S3
       http://timkay.com/aws/
       Easy to use CLI for EC2 and S3
       Implemented in Perl
       Authenticates using access id and secret
       key stored in ~/.awssecret




Chris Richardson — Running Java applications on Amazon EC2                             Slide 25
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                ElasticFox–
                ElasticFox Firefox plugin




Chris Richardson — Running Java applications on Amazon EC2                             Slide 26
Colorado Software Summit: October 19 – 24, 2008                        © Copyright 2008, Chris Richardson




                Launching instances




                                                             TIP: launch with a key
                                                                                  y
                                                             pair or else you won't
                                                             have access




Chris Richardson — Running Java applications on Amazon EC2                                       Slide 27
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Creating your own image
       Easier: Modify an existing AMI
                    y           g
              Launch AMI
              Configure: e.g. yum install …
       Harder: Build one from scratch
              Launch AMI
              Create a f l to contain OS installation
              C         file                  ll
              Mount as a loopback file
              Install OS: yum –-installroot
                                 installroot
       Use AMI tools to bundle and upload to S3


Chris Richardson — Running Java applications on Amazon EC2                             Slide 28
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Agenda
       Cloud computing with Amazon EC2
       Using Amazon EC2
       Overview of Cloud Tools
       Developing on Amazon EC2
       Deploying on Amazon EC2
       A few thoughts about Groovy



Chris Richardson — Running Java applications on Amazon EC2                             Slide 29
Colorado Software Summit: October 19 – 24, 2008                                                        © Copyright 2008, Chris Richardson



                Deploying a web application on
                EC2




                                    Not rocket science but there are many servers to configure and multiple files to upload



Chris Richardson — Running Java applications on Amazon EC2                                                                       Slide 30
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                What s
                What's Cloud Tools?
       Open source project
       32 and 64 bit AMIs
              CentOS 5.10
              Apache/Tomcat/MySQL/JMeter/JetS3t installed
               p             y Q
       EC2Deploy framework
              Launches instances
              Configures Tomcat MySQL Apache
                          Tomcat, MySQL,
              Deploys web applications
              Runs Jmeter tests
              Written in Groovy
       Maven and Grails plugins
              Quick and easy deployment to EC2


Chris Richardson — Running Java applications on Amazon EC2                             Slide 31
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                EC2Deploy framework
       Provides a DSL for describing a cluster:
              Number of Tomcats, MySQL slaves
              Database scripts
              Location of web applications
               o a o o      b app a o
       Launches EC2 instances
       Configures MySQL
       Configures T
       C fi        Tomcat and deploys web
                            dd l        b
       applications
       Configures Apache to proxy the Tomcat
       servers
       Runs JMeter tests


Chris Richardson — Running Java applications on Amazon EC2                             Slide 32
Colorado Software Summit: October 19 – 24, 2008                           © Copyright 2008, Chris Richardson




                Example EC2Deploy Script
def ec2 = new EC2(…)

ClusterSpec clusterSpec = new ClusterSpec()
          .tomcats(1)
          .instanceType(EC2InstanceType.SMALL)
          .slaves(1)
          .webApp('/home/cer/…/ptrack', quot;ptrackquot;)
            ebApp('/home/cer/ /ptrack'
          .catalinaOptsBuilder({optsBuilder, databaseHost, slaves ->
                     optsBuilder.arg(quot;-Xmx500mquot;)
                     optsBuilder.prop(quot;jdbc.db.serverquot;, databaseHost)})
          .schema(quot;ptrackquot;, [quot;ptrackquot;: quot;ptrackquot;],
                    [ s c/test/ esou ces/testd
                    [quot;src/test/resources/testdml1.sqlquot;,
                                                  .sq ,
                      quot;src/test/resources/testdml2.sqlquot;])

SimpleCluster cluster = new SimpleCluster(ec2, clusterSpec)

cluster.start()

cluster.loadTest(quot;/home/cer/…/jmeter/SimpleTest.jmxquot;, [5, 10, 15])

cluster.stop()




Chris Richardson — Running Java applications on Amazon EC2                                          Slide 33
Colorado Software Summit: October 19 – 24, 2008                                                                             © Copyright 2008, Chris Richardson




                Domain model
                                                                 ClusterSpec                  <<façade>>
                                                                                              SimpleCluster
                                                             name
                                                                                              stop()
                                                             numberOfTomcats
                                                                                              start()
                                                             numberOfMySqlSlaves
                                                                                              loadTest()
                                                             ...

                                      WebApp

                                 context                                                                 Jmeter
                                                              TomcatServer         MySqlServer                               ApacheServer
                                 explodedWar                                                           Application
                                 uploadToS3()
                                 updateTomcat()




                                                                                         <<abstract>>
                                                                                          Application




                                                              EC2                          EC2Server                  EC2InstanceState

                                                       startPolling()                 waitUntilRunning()             instanceId
                                                       stopPolling()                  stop()                         state
                                                       newServers(n)                  ssh(command)                   publicDnsName
                                                       ...                            ...                            privateDnsName



                               Uses Query API
                               to run, terminate
                                                                                                                       Executes ssh and
                               and describe
                                                         EC2Request                                                    scp commands
                               instances                                                         Ssh
                                                          Executor
                                                                                     ssh(dns, command, …)
                                                   executeRequest(params)




Chris Richardson — Running Java applications on Amazon EC2                                                                                            Slide 34
Colorado Software Summit: October 19 – 24, 2008                             © Copyright 2008, Chris Richardson




                Configuration DSL
class ApacheServer extends Application {

    def configure() {
           writeFile fileName: quot;$apacheConfDir/cluster.confquot;,
                templateName: quot;/templates/cluster.confquot;,
                templateArgs: [tomcats: tomcats]
           exec quot;$apacheBinDir/apachectl restartquot;
           waitForHttp port:80, path: tomcats[0].contexts[0]
     }
…
          class MySqlServer extends Application {
}
            def
            d f configureAsMaster() {
                   fi    A M t ()
                   writeFile fileName: quot;/etc/my.cnfquot;, templateName: quot;/templates/master.my.cnfquot;

                       restartService quot;mysqldquot;

                       exec command: quot;mysql -u rootquot;,
                           templateName: quot;/templates/createSchema.sqlquot;,
                           templateArgs: [schemaSpec: schemaSpec]

                       executeSchemaScripts()
                 }
          }


Chris Richardson — Running Java applications on Amazon EC2                                            Slide 35
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson



                Efficiently uploading web
                applications, etc.
                applications etc
       Non-durable disks = upload the entire web
       application
              20+ MBs of jars, etc.
              Takes a long time (over a DSL connection)
       Web
       W b application consists of:
              li   i       i     f
              90% 3rd party libraries – rarely changing
              10% application code and content – only some of it
              changes
               h
       Use JetS3t to accelerate uploads
              Incremental upload of exploded web application to S3
              bucket
              b k
              Incremental download to Tomcat webapps/ directory
              First upload is slow but subsequent uploads are fast


Chris Richardson — Running Java applications on Amazon EC2                             Slide 36
Colorado Software Summit: October 19 – 24, 2008                 © Copyright 2008, Chris Richardson




                Maven Plugin
                                                                     Goals:
                                                                     • deploy
     <plugin>                                                        • redeploy
                                                                     • stop
        <groupId>net.chrisrichardson</groupId>
        <groupId>net chrisrichardson</groupId>                       • dbsave
                                                                     • dbrestore
        <artifactId>cloudtools-maven-plugin</artifactId>             • jmeter
        <configuration>
          <schemaName>ptrack</schemaName>
          <schemaUsers>
            <param>ptrack:ptrack</param>
          </schemaUsers>
          <catalinaOptsBuilder>
            {
            {builder, databasePrivateDnsName ->
                    ,
               builder.arg(quot;-Xmx1000mquot;)
               builder.prop(quot;jdbc.db.serverquot;, databasePrivateDnsName)}
            </catalinaOptsBuilder>
          </configuration>
     </plugin>


   mvn cloudtools:deploy




Chris Richardson — Running Java applications on Amazon EC2                                Slide 37
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Grails Plugin
            Packages E2Deploy as a Grails
            framework plugin
            Deploys a Grails application to EC2


       $ grails install-plugin <path to plugin>
       $ grails cloud-tools-deploy
         g                     p y




Chris Richardson — Running Java applications on Amazon EC2                             Slide 38
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Agenda
       Cloud computing with Amazon EC2
       Using Amazon EC2
       Overview of Cloud Tools
       Developing on Amazon EC2
       Deploying on Amazon EC2
       A few thoughts about Groovy



Chris Richardson — Running Java applications on Amazon EC2                             Slide 39
Colorado Software Summit: October 19 – 24, 2008                                      © Copyright 2008, Chris Richardson




                 Collecting pe fo mance metrics
                            performance met ics
    70                                                                 7000

    60                                                                 6000

    50                                                                 5000

    40                                                                 4000
                                                                              TPS
    30                                                                 3000
                                                                              ART
    20                                                                 2000

    10                                                                 1000

      0
             1        2         4        8        16         32   64
                                                                       0
                                                                               R   i
                                                                               Requires
                                                                               hardware
                                                                               Time consuming
 Measure transactions/second (TPS), average response time (ART), utilization, etc.

 Multiple test runs with different loads, number of servers, etc.




Chris Richardson — Running Java applications on Amazon EC2                                                     Slide 40
Colorado Software Summit: October 19 – 24, 2008                                                      © Copyright 2008, Chris Richardson




                Load testing with Cloud Tools
           Runs JMeter with
                                                                         <performanceReport>
                                                                           <cpus>1</cpus>
                                                                           <threads>10</threads>


           specified number
                                                                           <host>
                                                                             <name>database</name>
                                                                             <cpuUtil>3.2757014224403784</cpuUtil>

           of threads                                                      </host>
                                                                           <host>
                                                                             <name>tomcat0</name>


           Collects machine
                                                                             <cpuUtil>94.32473318917411</cpuUtil>
                                                                           </host>



           utilization stats
                                                                           <host>
                                                                             <name>apache</name>
                                                                             <cpuUtil>0.12280614752518504</cpuUtil>
                                                                               p                          / p
                                                                           </host>

           Generates reports                                               <host>
                                                                             <name>jmeter</name>
                                                                             <cpuUtil>7.033683910704496</cpuUtil>


           Executes multiple
                                                                           </host>
                                                                           …
                                                                           <duration>557.943</duration>

           test runs                                                       <tps>10.753786677133686</tps>
                                                                           <art>916.6578333333</art>


           simultaneously
                                                                         </performanceReport>



                                           mvn cloudtools:jmeter -Dcloudtools.thread.count=1,4,8


Chris Richardson — Running Java applications on Amazon EC2                                                                     Slide 41
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Other kinds of testing
       Testing failover
             g
              Launch cluster
              Take down servers
              Test recovery scripts, e.g. MySQL slave-
              >master
       Testing database upgrades
              Launch cluster
              Install snapshot of production data
              Apply database migration script
              Verify that it works
                   y

Chris Richardson — Running Java applications on Amazon EC2                             Slide 42
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Functional testing
       Tests can be slow, e.g.
              Web tests
              Database intensive tests
       Run tests in parallel on EC2
              Multiple test drivers, app servers, DBs
              Relatively cheap: >$75/hour developer vs.
              $0.10/hour
              $0 10/hour machine
       Selenium Grid from Thoughtworks
              Open Source framework
              Runs Selenium web tests in parallel on EC2
       Stay tuned for more general solutions


Chris Richardson — Running Java applications on Amazon EC2                             Slide 43
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Building on a fresh machine
       Debug builds that fail because of a
       missing dependency
              Maven dependency
              Manually installed 3rd party library
       Build on a fresh EC2 instance
       Great for open-source projects




Chris Richardson — Running Java applications on Amazon EC2                             Slide 44
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Agenda
       Cloud computing with Amazon EC2
       Using Amazon EC2
       Overview of Cloud Tools
       Developing on Amazon EC2
       Deploying on Amazon EC2
       A few thoughts about Groovy



Chris Richardson — Running Java applications on Amazon EC2                             Slide 45
Colorado Software Summit: October 19 – 24, 2008                             © Copyright 2008, Chris Richardson



                  Deploying applications on
                  Amazon
                  Ama on EC2
         Great for startups (especially
         those without a business model)
                Get up and running ready quickly
                No upfront hardware costs
                Scale
                S l up/down with load
                        /d       ith l d
                Reduces the risk of a success
                catastrophe
         Great f enterprises
         G   t for t    i
                No need to wait for corporate IT
                Use for short-term projects                         Cloud Computing Survey: IT
                                                                    Leaders See Big Promise, Have
                                                                    Big Security Questions

www.cio.com/article/455832/Cloud_Computing_Survey_IT_Leaders_See_Big_Promise_Have_Big_Security_Questi
ons




  Chris Richardson — Running Java applications on Amazon EC2                                            Slide 46
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Issues with AWS
       Security:
              Lack of PCI compliance
              Discomfort with sending
              customer data to a 3rd party
       Technology:
              Not yet suitable for extremely
              large relational databases
              Lack of very large machines,
              e.g. 64G memory
              Lack of multicast
       Financials:
              Cost of bandwidth
              Steady state costs > your own
              hardware



Chris Richardson — Running Java applications on Amazon EC2                             Slide 47
Colorado Software Summit: October 19 – 24, 2008                               © Copyright 2008, Chris Richardson




                Starter website - $
                                                             www.acme.com



                                                  Elastic IP A

                                                  EC2 Instance




                                                                   Apache




                                                                   Tomcat




                                                                   MySQL




                                                                 EBS Volume




Chris Richardson — Running Java applications on Amazon EC2                                              Slide 48
Colorado Software Summit: October 19 – 24, 2008                                                                     © Copyright 2008, Chris Richardson




                Highly available - $$
                                                                    www.acme.com




                                 Elastic IP A                                      Elastic IP B

                                 Availability Zone A                               Availability Zone B



                                                                                                         Apache
                                                        Apache




                                                        Tomcat                                            Tomcat
                                                         Tomcat                                            Tomcat




                                                                                                          MySQL
                                                         MySQL
                                                                                                          (slave)
                                                        (Master)




                                                       EBS Volume




Chris Richardson — Running Java applications on Amazon EC2                                                                                    Slide 49
Colorado Software Summit: October 19 – 24, 2008                      © Copyright 2008, Chris Richardson




                Batch processing architecture
                                                             e.g.
                                                             e g media transcoding




Chris Richardson — Running Java applications on Amazon EC2                                     Slide 50
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Easy upgrades
       Clone production environment
       Apply upgrades
       Terminate old instances once you are
       sure that everything works




Chris Richardson — Running Java applications on Amazon EC2                             Slide 51
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Cloud bursting
       Host application on your own hardware
       Use AWS for short-term spikes
              e g use EC2 instances with slave DBs to
              e.g.
              handle read-only requests
       Periodic batch jobs
              E.g. content rendering/transformation




Chris Richardson — Running Java applications on Amazon EC2                             Slide 52
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Using AWS in your application
                              o
       Simple Storage Service (S3)
              Stores blobs of data
              St     bl b f d t
              Eg. Photo sharing website
              Store media
              Hand out URLs to S3 objects
       Simple Queue Service (SQS)
              Hosted queue-based messaging system
                      q                 g g y
              Alternative to JMS
              Loosely coupling between systems
       SimpleDB
              Store data sets
              Execute queries



Chris Richardson — Running Java applications on Amazon EC2                             Slide 53
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Java libraries for AWS
       JetS3t
              Rich API for accessing S3
              jets3t.dev.java.net/
       Typica
       T i
              API for SQS, EC2,
                  p
              SimpleDB
              code.google.com/p/typica
       SimpleJPA
              Subset of JPA on Simple
              DB
              code.google.com/p/simplej
              pa
Chris Richardson — Running Java applications on Amazon EC2                             Slide 54
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Agenda
       Cloud computing with Amazon EC2
       Using Amazon EC2
       Overview of Cloud Tools
       Developing on Amazon EC2
       Deploying on Amazon EC2
       A few thoughts about Groovy



Chris Richardson — Running Java applications on Amazon EC2                             Slide 55
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                About Groovy
       Object-oriented, dynamic language
       Object oriented,
       Java compatible
       Runs on the JVM




Chris Richardson — Running Java applications on Amazon EC2                             Slide 56
Getting Groovy code to work
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                can be frustrating
       Dynamic language = less information
       for IDE:
              Limited compile-time checking
                      compile time
              Limited refactorings
              Limited completion




Chris Richardson — Running Java applications on Amazon EC2                             Slide 57
Colorado Software Summit: October 19 – 24, 2008                              © Copyright 2008, Chris Richardson



                Groovy fans say quot;write unit
                tests“ BUT
                       BUT…


                                                                                                    Groovy




                                                                      When you have typos
                                                             versus




                                                                                                        Java




Chris Richardson — Running Java applications on Amazon EC2                                             Slide 58
Colorado Software Summit: October 19 – 24, 2008                                    © Copyright 2008, Chris Richardson



                Unit tests don't always catch
                errors
                e o s
      void testPollStatus_discoveringNewServer() {
           mockEC2RequestExecutor.demand.executeRequst {params ->
             ….
           }
           def mockEC2Server = new MockFor(EC2Server.class)
           ….
          mockEC2Server.use {
              mockEC2RequestExecutor.use {
                ec2 = new EC2(awsProperties)
                ec2.pollStatus()                 public class EC2 {
                assertEquals 1, ec2.servers.size()
              }                                    public pollStatus() {
           }                                          def params = ['Action':
        }                                        'DescribeInstances']
                                                                 def p =
                                                             requestor.executeRequst(params)
                                                             requestor executeRequst(params)
   class EC2RequestExecutor {                                    ….
                                                               }
    public Node executeRequest(Map                           …
   parameters) {                                             }
     …
   }
                                                                    Same typo in test and in code


Chris Richardson — Running Java applications on Amazon EC2                                                   Slide 59
Colorado Software Summit: October 19 – 24, 2008                         © Copyright 2008, Chris Richardson




                Things I like: Java compatible
                         like Ja a
     import javax.crypto.Mac;
     import javax.crypto.spec.SecretKeySpec;

     class EC2RequestExecutor {                                Java-like syntax
                                                               Use Java libraries
      Log logger = LogFactory.getLog(getClass())

      public String calculateRFC2104HMAC(String data, String key) {
        try {
          SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(quot;UTF8quot;),

     HMAC SHA1 ALGORITHM)
     HMAC_SHA1_ALGORITHM)
          Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM)
          mac.init(signingKey)
          byte[] rawHmac = mac.doFinal(data.getBytes())
          return new String(Base64.encodeBase64(rawHmac))
                          g(                     (        ))
        }
        catch (Exception e) {
          throw new RuntimeException(quot;Failed to generate HMAC : quot;, e)
      }
     }



Chris Richardson — Running Java applications on Amazon EC2                                        Slide 60
Colorado Software Summit: October 19 – 24, 2008                                       © Copyright 2008, Chris Richardson



                Groovy is concise and
                expressive
                e p essi e
     def configureAsMaster() {
           writeFile fileName: quot;/etc/my.cnfquot;, templateName: quot;/templates/master.my.cnfquot;

              restartService quot;mysqldquot;

              exec command: quot;mysql -u rootquot;,
                       templateName: quot;/templates/createSchema.sqlquot;,
                                        /templates/createSchema.sql ,                No parens
                       templateArgs: [schemaSpec: schemaSpec]                        Keyword parameters


              executeSchemaScripts()
         }




             class TomcatServer {                            tomcatServer.contexts
                                                                                          No
                                                                                          N get…()
                                                                                              t ()
              def getContexts() {
                   webApps.context
               }
             }




Chris Richardson — Running Java applications on Amazon EC2                                                      Slide 61
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Closures

        def sortServers(servers) {
          servers.sort {a, b -> a.instanceId <=> b.instanceId}
        }

        public EC2Server findInstance(String instanceId) {
           def server = servers.find {instanceId == it.instanceId}
                                     {                           }
           if (server)
             return server
           else throw new RuntimeException(….)
         }




Chris Richardson — Running Java applications on Amazon EC2                             Slide 62
Colorado Software Summit: October 19 – 24, 2008                                   © Copyright 2008, Chris Richardson




                XML and GPath expressions
                                                             <RunInstancesResponse>
                                                             …
                                                             <instancesSet>
                                                               <item>
                                                                  <instanceId>i-4ef21327</instanceId>
                                                                  <imageId>ami-3795705e</imageId>
                                                                  <instanceState>
                                                                     <code>0</code>
def client = new HttpClient()                                        <name>pending</name>
…                                                                 </instanceState>
def responseStream =                                              <dnsName/>
getMethod.getResponseBodyAsStream()
getMethod getResponseBodyAsStream()                          …
                                                             </RunInstancesResponse>
def parser = new XmlParser(false, false)
def response = parser.parseText(responseStream)

def newServers = response instancesSet item collect {
                   response.instancesSet.item.collect
   new EC2Server(this, awsProperties, ssh,
     it.instanceId[0].text(),
     it.instanceState[0].children()[1].value()[0])
}



Chris Richardson — Running Java applications on Amazon EC2                                                  Slide 63
Colorado Software Summit: October 19 – 24, 2008                         © Copyright 2008, Chris Richardson




                GStrings and templates
      def schemaScript = quot;quot;quot;
        DROP SCHEMA IF EXISTS ${schemaSpec.name};
        CREATE SCHEMA ${schemaSpec.name};
           quot;quot;quot;


   String process(String templateName, Map params) {
        InputStream stream = getClass().getResourceAsStream(templateName)
        def engine = new groovy.text.SimpleTemplateEngine()
        engine.createTemplate(new InputStreamReader(stream)).make(params).toString()
     }

     …
     <%
          contexts.each {%>ProxyPass /$it balancer://mycluster/$it stickysession=jsessionid
     <%}%>
     <Proxy balancer://mycluster>
      <%
          tomcats.each {%>BalancerMember ajp://${it.hostPrivateDnsName}:8009
     route=${it.jvmRoute} min=1 keepalive=On retry=5
     <%                }
     %>
     …

Chris Richardson — Running Java applications on Amazon EC2                                        Slide 64
Colorado Software Summit: October 19 – 24, 2008                                     © Copyright 2008, Chris Richardson




                Builders
    def report(String path, hosts, cpuCount, threadCount) {
      def builder = new groovy.xml.MarkupBuilder(new OutputStreamWriter(new FileOutputStream(path)))
      builder.performanceReport {
       cpus cpuCount
       threads threadCount
       hosts.entrySet().each { hostEntry ->
        host {
         name hostEntry.key                                                <performanceReport>
         cpuUtil hostEntry value getAverageBusy()
                  hostEntry.value.getAverageBusy()                           <cpus>1</cpus>
        }                                                                    <threads>10</threads>
       }                                                                     <host>
       requests {
                                                                                <name>database</name>
         timings.entrySet().sort{ a, b-> a.key <=> b.key}.each{ pair ->
          request {                                                             <cpuUtil>3.27</cpuUtil>
           name pair key
                  pair.key                                                   </host>
           art pair.value.average()                                          <host>
           errors pair.value.errorPercentage()                                  <name>tomcat0</name>
          }
                                                                                <cpuUtil>94.32</cpuUtil>
         }
       }                                                                     </host>
       d fd     ti V l                           t tTi   ))/1000 0
                             ((float)(endTime - startTime))/1000.0
       def durationValue = ((fl t)( dTi                                    …
       duration durationValue                                               <duration>557.943</duration>
       def tpsValue = transactionCount/ durationValue                        <tps>10.753786677133686</tps>
       tps tpsValue
                                                                             <art>916.6578333333</art>
       art averageResponseTime()
      }                                                                    </performanceReport>
      }




Chris Richardson — Running Java applications on Amazon EC2                                                    Slide 65
Colorado Software Summit: October 19 – 24, 2008              © Copyright 2008, Chris Richardson




                Summary
       Cloud Computing
              Immediate access to many servers
              Pay as you go – no upfront investment/commitment
              required
              Easily scale up/down
       Cloud Tools
              Easy deployment and testing from Maven and Grails
              Configure multiple clusters
                   g         p
              Run JMeter tests in parallel
       Using Groovy
              Has some nice features
              Dynamic language features are double-edged sword
              We need better statically typed languages




Chris Richardson — Running Java applications on Amazon EC2                             Slide 66
Colorado Software Summit: October 19 – 24, 2008                                          © Copyright 2008, Chris Richardson




                Final thoughts
                                                                Download Cloud Tools today:

                                                             http://code.google.com/p/cloudtools

                                                                Buy my book ☺

                                                                Send email:

                                                             chris@chrisrichardson.net

                                                                Visit my website:

                                                             http://www.chrisrichardson.net

                                                                Talk to me about consulting and
                                                                training
                                                                t i i


Chris Richardson — Running Java applications on Amazon EC2                                                         Slide 67

More Related Content

What's hot

AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...Amazon Web Services
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSAmazon Web Services
 
Migrating Existing Applications to AWS Cloud
Migrating Existing Applications to AWS CloudMigrating Existing Applications to AWS Cloud
Migrating Existing Applications to AWS Cloudjineshvaria
 
Building a Secured Network environment on AWS
Building a Secured Network environment on AWSBuilding a Secured Network environment on AWS
Building a Secured Network environment on AWSAmazon Web Services
 
Module 1: AWS Cloud Concepts, VPC, and Security Groups - Virtual AWSome Day J...
Module 1: AWS Cloud Concepts, VPC, and Security Groups - Virtual AWSome Day J...Module 1: AWS Cloud Concepts, VPC, and Security Groups - Virtual AWSome Day J...
Module 1: AWS Cloud Concepts, VPC, and Security Groups - Virtual AWSome Day J...Amazon Web Services
 
Learn to run on the cloud with AWS Training and Certification - ANZ Webinar S...
Learn to run on the cloud with AWS Training and Certification - ANZ Webinar S...Learn to run on the cloud with AWS Training and Certification - ANZ Webinar S...
Learn to run on the cloud with AWS Training and Certification - ANZ Webinar S...Amazon Web Services
 
How AWS Minimizes the Blast Radius of Failures (ARC338) - AWS re:Invent 2018
How AWS Minimizes the Blast Radius of Failures (ARC338) - AWS re:Invent 2018How AWS Minimizes the Blast Radius of Failures (ARC338) - AWS re:Invent 2018
How AWS Minimizes the Blast Radius of Failures (ARC338) - AWS re:Invent 2018Amazon Web Services
 
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...Amazon Web Services Korea
 
CloudFront로 동적 컨텐츠를 전송하는 네가지 이유 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudFront로 동적 컨텐츠를 전송하는 네가지 이유 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 GamingCloudFront로 동적 컨텐츠를 전송하는 네가지 이유 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudFront로 동적 컨텐츠를 전송하는 네가지 이유 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 GamingAmazon Web Services Korea
 
AWS Security Week: AWS Secrets Manager
AWS Security Week: AWS Secrets ManagerAWS Security Week: AWS Secrets Manager
AWS Security Week: AWS Secrets ManagerAmazon Web Services
 
NOSQLの基礎知識(講義資料)
NOSQLの基礎知識(講義資料)NOSQLの基礎知識(講義資料)
NOSQLの基礎知識(講義資料)CLOUDIAN KK
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAmazon Web Services
 
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...Amazon Web Services
 
All you need to know about Auto scaling - Pop-up Loft
All you need to know about Auto scaling - Pop-up LoftAll you need to know about Auto scaling - Pop-up Loft
All you need to know about Auto scaling - Pop-up LoftAmazon Web Services
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Amazon Web Services
 
Introduction to AWS (Amazon Web Services)
Introduction to AWS (Amazon Web Services)Introduction to AWS (Amazon Web Services)
Introduction to AWS (Amazon Web Services)Albert Suwandhi
 

What's hot (20)

Cloud Security Fundamentals Webinar
Cloud Security Fundamentals WebinarCloud Security Fundamentals Webinar
Cloud Security Fundamentals Webinar
 
AWS Foundations
AWS FoundationsAWS Foundations
AWS Foundations
 
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
 
Amazon GuardDuty Lab
Amazon GuardDuty LabAmazon GuardDuty Lab
Amazon GuardDuty Lab
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKS
 
Migrating Existing Applications to AWS Cloud
Migrating Existing Applications to AWS CloudMigrating Existing Applications to AWS Cloud
Migrating Existing Applications to AWS Cloud
 
Building a Secured Network environment on AWS
Building a Secured Network environment on AWSBuilding a Secured Network environment on AWS
Building a Secured Network environment on AWS
 
Module 1: AWS Cloud Concepts, VPC, and Security Groups - Virtual AWSome Day J...
Module 1: AWS Cloud Concepts, VPC, and Security Groups - Virtual AWSome Day J...Module 1: AWS Cloud Concepts, VPC, and Security Groups - Virtual AWSome Day J...
Module 1: AWS Cloud Concepts, VPC, and Security Groups - Virtual AWSome Day J...
 
Learn to run on the cloud with AWS Training and Certification - ANZ Webinar S...
Learn to run on the cloud with AWS Training and Certification - ANZ Webinar S...Learn to run on the cloud with AWS Training and Certification - ANZ Webinar S...
Learn to run on the cloud with AWS Training and Certification - ANZ Webinar S...
 
How AWS Minimizes the Blast Radius of Failures (ARC338) - AWS re:Invent 2018
How AWS Minimizes the Blast Radius of Failures (ARC338) - AWS re:Invent 2018How AWS Minimizes the Blast Radius of Failures (ARC338) - AWS re:Invent 2018
How AWS Minimizes the Blast Radius of Failures (ARC338) - AWS re:Invent 2018
 
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
 
CloudFront로 동적 컨텐츠를 전송하는 네가지 이유 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudFront로 동적 컨텐츠를 전송하는 네가지 이유 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 GamingCloudFront로 동적 컨텐츠를 전송하는 네가지 이유 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudFront로 동적 컨텐츠를 전송하는 네가지 이유 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
 
AWS Security Week: AWS Secrets Manager
AWS Security Week: AWS Secrets ManagerAWS Security Week: AWS Secrets Manager
AWS Security Week: AWS Secrets Manager
 
NOSQLの基礎知識(講義資料)
NOSQLの基礎知識(講義資料)NOSQLの基礎知識(講義資料)
NOSQLの基礎知識(講義資料)
 
Security on AWS
Security on AWSSecurity on AWS
Security on AWS
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar Series
 
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
 
All you need to know about Auto scaling - Pop-up Loft
All you need to know about Auto scaling - Pop-up LoftAll you need to know about Auto scaling - Pop-up Loft
All you need to know about Auto scaling - Pop-up Loft
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
 
Introduction to AWS (Amazon Web Services)
Introduction to AWS (Amazon Web Services)Introduction to AWS (Amazon Web Services)
Introduction to AWS (Amazon Web Services)
 

Viewers also liked

Deploying Java Applications in the AWS Cloud
Deploying Java Applications in the AWS CloudDeploying Java Applications in the AWS Cloud
Deploying Java Applications in the AWS CloudAmazon Web Services
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCGR8Conf
 
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013Amazon Web Services
 
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015Amazon Web Services Korea
 
Pitch Deck Beved - Demo Day SEED
Pitch Deck Beved - Demo Day SEEDPitch Deck Beved - Demo Day SEED
Pitch Deck Beved - Demo Day SEEDMatt Montenegro
 
Best Practices running SQL Server on AWS
Best Practices running SQL Server on AWSBest Practices running SQL Server on AWS
Best Practices running SQL Server on AWSAmazon Web Services
 

Viewers also liked (6)

Deploying Java Applications in the AWS Cloud
Deploying Java Applications in the AWS CloudDeploying Java Applications in the AWS Cloud
Deploying Java Applications in the AWS Cloud
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
Accelerate Your Java Development on AWS (TLS301) | AWS re:Invent 2013
 
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015
 
Pitch Deck Beved - Demo Day SEED
Pitch Deck Beved - Demo Day SEEDPitch Deck Beved - Demo Day SEED
Pitch Deck Beved - Demo Day SEED
 
Best Practices running SQL Server on AWS
Best Practices running SQL Server on AWSBest Practices running SQL Server on AWS
Best Practices running SQL Server on AWS
 

Similar to Deploying Java Applicationson Ec2

CommunityOneEast 09 - Running Java On Amazon EC2
CommunityOneEast 09 - Running Java On Amazon EC2CommunityOneEast 09 - Running Java On Amazon EC2
CommunityOneEast 09 - Running Java On Amazon EC2Chris Richardson
 
SD Forum Java SIG - Running Java Applications On Amazon EC2
SD Forum Java SIG - Running Java Applications On Amazon EC2SD Forum Java SIG - Running Java Applications On Amazon EC2
SD Forum Java SIG - Running Java Applications On Amazon EC2Chris Richardson
 
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...Chris Richardson
 
Semplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSSemplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSAmazon Web Services
 
Improving Tests With Object Mothers And Internal Dsls
Improving Tests With Object Mothers And Internal DslsImproving Tests With Object Mothers And Internal Dsls
Improving Tests With Object Mothers And Internal DslsChris Richardson
 
SRV409 Deep Dive on Microservices and Docker
SRV409 Deep Dive on Microservices and DockerSRV409 Deep Dive on Microservices and Docker
SRV409 Deep Dive on Microservices and DockerAmazon Web Services
 
SRV409 Deep Dive on Microservices and Docker
SRV409 Deep Dive on Microservices and DockerSRV409 Deep Dive on Microservices and Docker
SRV409 Deep Dive on Microservices and DockerAmazon Web Services
 
Netflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsNetflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsAdrian Cockcroft
 
Build an app on aws for your first 10 million users (2)
Build an app on aws for your first 10 million users (2)Build an app on aws for your first 10 million users (2)
Build an app on aws for your first 10 million users (2)AWS Vietnam Community
 
Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Brendan Bouffler
 
devworkshop-10_28_1015-amazon-conference-presentation
devworkshop-10_28_1015-amazon-conference-presentationdevworkshop-10_28_1015-amazon-conference-presentation
devworkshop-10_28_1015-amazon-conference-presentationAlex Wu
 
From Zero to still Zero: The most beautiful mistakes going into the cloud.
From Zero to still Zero: The most beautiful mistakes going into the cloud. From Zero to still Zero: The most beautiful mistakes going into the cloud.
From Zero to still Zero: The most beautiful mistakes going into the cloud. OPEN KNOWLEDGE GmbH
 
Migrating Microsoft Applications to AWS like an Expert - AWS Summit Sydney 2018
Migrating Microsoft Applications to AWS like an Expert - AWS Summit Sydney 2018Migrating Microsoft Applications to AWS like an Expert - AWS Summit Sydney 2018
Migrating Microsoft Applications to AWS like an Expert - AWS Summit Sydney 2018Amazon Web Services
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019AWS Summits
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019Amazon Web Services
 
Integrating Deep Learning into your Enterprise
Integrating Deep Learning into your EnterpriseIntegrating Deep Learning into your Enterprise
Integrating Deep Learning into your EnterpriseAmazon Web Services
 

Similar to Deploying Java Applicationson Ec2 (20)

CommunityOneEast 09 - Running Java On Amazon EC2
CommunityOneEast 09 - Running Java On Amazon EC2CommunityOneEast 09 - Running Java On Amazon EC2
CommunityOneEast 09 - Running Java On Amazon EC2
 
SD Forum Java SIG - Running Java Applications On Amazon EC2
SD Forum Java SIG - Running Java Applications On Amazon EC2SD Forum Java SIG - Running Java Applications On Amazon EC2
SD Forum Java SIG - Running Java Applications On Amazon EC2
 
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
 
Semplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSSemplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWS
 
Improving Tests With Object Mothers And Internal Dsls
Improving Tests With Object Mothers And Internal DslsImproving Tests With Object Mothers And Internal Dsls
Improving Tests With Object Mothers And Internal Dsls
 
SRV409 Deep Dive on Microservices and Docker
SRV409 Deep Dive on Microservices and DockerSRV409 Deep Dive on Microservices and Docker
SRV409 Deep Dive on Microservices and Docker
 
SRV409 Deep Dive on Microservices and Docker
SRV409 Deep Dive on Microservices and DockerSRV409 Deep Dive on Microservices and Docker
SRV409 Deep Dive on Microservices and Docker
 
Netflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsNetflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and Ops
 
Python on AWS Lambda
Python on AWS Lambda Python on AWS Lambda
Python on AWS Lambda
 
Build an app on aws for your first 10 million users (2)
Build an app on aws for your first 10 million users (2)Build an app on aws for your first 10 million users (2)
Build an app on aws for your first 10 million users (2)
 
Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018
 
From Monolith to Microservices
From Monolith to MicroservicesFrom Monolith to Microservices
From Monolith to Microservices
 
Netflix in the cloud 2011
Netflix in the cloud 2011Netflix in the cloud 2011
Netflix in the cloud 2011
 
ARC205_Born in the Cloud
ARC205_Born in the CloudARC205_Born in the Cloud
ARC205_Born in the Cloud
 
devworkshop-10_28_1015-amazon-conference-presentation
devworkshop-10_28_1015-amazon-conference-presentationdevworkshop-10_28_1015-amazon-conference-presentation
devworkshop-10_28_1015-amazon-conference-presentation
 
From Zero to still Zero: The most beautiful mistakes going into the cloud.
From Zero to still Zero: The most beautiful mistakes going into the cloud. From Zero to still Zero: The most beautiful mistakes going into the cloud.
From Zero to still Zero: The most beautiful mistakes going into the cloud.
 
Migrating Microsoft Applications to AWS like an Expert - AWS Summit Sydney 2018
Migrating Microsoft Applications to AWS like an Expert - AWS Summit Sydney 2018Migrating Microsoft Applications to AWS like an Expert - AWS Summit Sydney 2018
Migrating Microsoft Applications to AWS like an Expert - AWS Summit Sydney 2018
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
 
Integrating Deep Learning into your Enterprise
Integrating Deep Learning into your EnterpriseIntegrating Deep Learning into your Enterprise
Integrating Deep Learning into your Enterprise
 

More from Chris Richardson

The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?Chris Richardson
 
More the merrier: a microservices anti-pattern
More the merrier: a microservices anti-patternMore the merrier: a microservices anti-pattern
More the merrier: a microservices anti-patternChris Richardson
 
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...Chris Richardson
 
Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!Chris Richardson
 
Dark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patternsDark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patternsChris Richardson
 
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdfScenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdfChris Richardson
 
Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions Chris Richardson
 
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...Chris Richardson
 
Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...Chris Richardson
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 Chris Richardson
 
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice ArchitectureQConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice ArchitectureChris Richardson
 
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...Chris Richardson
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled servicesChris Richardson
 
Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Chris Richardson
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...Chris Richardson
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Chris Richardson
 
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...Chris Richardson
 
Overview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders applicationOverview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders applicationChris Richardson
 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate PlatformChris Richardson
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolithChris Richardson
 

More from Chris Richardson (20)

The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?
 
More the merrier: a microservices anti-pattern
More the merrier: a microservices anti-patternMore the merrier: a microservices anti-pattern
More the merrier: a microservices anti-pattern
 
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
 
Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!
 
Dark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patternsDark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patterns
 
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdfScenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
 
Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions
 
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
 
Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
 
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice ArchitectureQConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
 
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled services
 
Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...
 
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
 
Overview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders applicationOverview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders application
 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate Platform
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith
 

Recently uploaded

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Deploying Java Applicationson Ec2

  • 1. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Running Java applications on the Amazon Elastic Compute Cloud Chris Richardson Author of POJOs in Action Founder of Cloud Tools www.chrisrichardson.net Chris Richardson – Running Java applications on Amazon EC2 Slide 1
  • 2. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Overall presentation goal Show how to use Amazon Elastic Compute Cloud for developing and deploying Java applications Chris Richardson — Running Java applications on Amazon EC2 Slide 2
  • 3. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson About Chris Grew up in England and live in Oakland, CA p g , Over twenty years of software development experience Building object-oriented software since 1986 Using Java since 1996 Using J2EE since 1999 Author of POJOs in Action Speaker at JavaOne, SpringOne, NFJS, JavaPolis, Spring Experience, etc. Chair of the eBIG Java SIG in Oakland (www.ebig.org) (www ebig org) Run a consulting and training company that helps organizations build better software faster and deploy it on Amazon EC2 Founder of Cloud Tools, an open-source project for d l i f deploying J Java applications on Amazon EC2: li ti A EC2 http://code.google.com/p/cloudtools Chris Richardson — Running Java applications on Amazon EC2 Slide 3
  • 4. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Agenda Cloud computing with Amazon EC2 Using Amazon EC2 Overview of Cloud Tools Developing on Amazon EC2 Deploying on Amazon EC2 A few thoughts about Groovy Chris Richardson — Running Java applications on Amazon EC2 Slide 4
  • 5. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Computing Comp ting has come a long way a Present Past www.computermuseum.org.uk www.dell.com Yet we rarely have enough Chris Richardson — Running Java applications on Amazon EC2 Slide 5
  • 6. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Cloud computing A pool of highly scalable, abstracted infrastructure that hosts your application, and is billed by consumption p By James Staten of Forrester Research Chris Richardson — Running Java applications on Amazon EC2 Slide 6
  • 7. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Power generation Past Present Chris Richardson — Running Java applications on Amazon EC2 Slide 7
  • 8. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Amazon-Style Cloud Computing Ama on St le Clo d Comp ting Elastic Compute Cloud (EC2) On-demand computing Elastic Block Storage (EBS) quot;SAN on demandquot; SAN demand Simple Storage Service (S3) Stores blobs of data Si Simple Queue S l Q Service (SQS) i Hosted queue-based messaging system SimpleDB Store data sets Pay per use Execute queries services managed by Amazon Chris Richardson — Running Java applications on Amazon EC2 Slide 8
  • 9. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson What is Amazon EC2? Virtualized computing environment S i d h Server instances managed through a web service API h b i IP addresses and host names assigned dynamically Pay by the hour ($0.10-0.80/hour) + external bandwidth ($0 10-0 18/Gbyte) ($0.10 0.18/Gbyte) https://ec2.amazonaws.com/?Action=RunInstances <RunInstancesResponse> &ImageId=ami-398438493 … &MaxCount=3 </RunInstancesResponse> &MinCount=3 cer@arrakis ~ k $ ssh … root@ec2-67-202-41-150.compute-1.amazonaws.com Last login: Sun Dec 30 18:54:43 2007 from 71.131.29.181 [root@domU-12-31-36-00-38-23:~] Chris Richardson — Running Java applications on Amazon EC2 Slide 9
  • 10. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Instance types Virtual Compute p 32// Memory y Storage $/hr g $/ Cores Units 64 /core* Bit Small 1 1 32 bit 1.7G 160G 0.10 High- 2 2.5 32 bit 1.7G 350G 0.20 CPU Medium Large 2 2 64 bit 7.5G 850G 0.40 Extra 4 2 64 bit 15G 1690G 0.80 Large High- 8 2.5 64 bit 7G 1690G 0.80 CPU XL * EC2 Compute Unit = 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor Chris Richardson — Running Java applications on Amazon EC2 Slide 10
  • 11. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Operating systems Use Amazon provided Machine Image (AMI) 32-bit 32 bit Fedora Core 4 64-bit Fedora Core 6 Many 3rd parties have public AMIs Various Linux distributions E.g. Redhat, RightScale Sun provides OpenSolaris Windows is in beta: Windows Server 2003 ($0.125-$2/hour) Optional SQL Server Standard ($1.10-3.20/hour) Build your own Linux: Install applications starting with someone else's AMI and save it Create an AMI from scratch Chris Richardson — Running Java applications on Amazon EC2 Slide 11
  • 12. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson One minor thing thing… Terminate your i t T i t instance ⇒ y your local data is lost. Either very good or very bad Chris Richardson — Running Java applications on Amazon EC2 Slide 12
  • 13. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Elastic Block Storage Mountable storage volumes quot;On-demand SANquot; Size: 1 GB to 1 TB Mount on a single instance Create snapshots Stored in S3 Create new volumes from the snapshot Cost: $0.10/GByte/month $0.10 per 1 million I/O requests Chris Richardson — Running Java applications on Amazon EC2 Slide 13
  • 14. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Elastic IP addresses Instance IP addresses are dynamically allocated on start up start-up Does not work well for publicly accessible services, e.g. a website Elastic IP addresses: Statically allocated addresses Associated with your account (max. 5) Att h d t an i t Attached to instance ( (e.g. public f i bli facing web b server) You configure DNS to resolve to the elastic IP address Pricing: P i i Non-attached Elastic IP address - $0.01/hour $0.10 per remap (if > 100 in a month) Chris Richardson — Running Java applications on Amazon EC2 Slide 14
  • 15. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Regions and a ailabilit zones availability ones By default, your database master and slave could run on the same physical host! Regions: Geographically dispersed locations Currently only one Availability zone: Part of a region Engineered to be insulated from failure in other zones Specify availability zone when launching instances: Same zone as other instances for free data transfer Different zone for higher-availability g y SLA with 99.95% region availability Instances have external connectivity You can launch new instances Chris Richardson — Running Java applications on Amazon EC2 Slide 15
  • 16. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson What is the Amazon Simple Storage Se ice Sto age Service (S3)? Flat storage model consisting of buckets and objects Bucket – has a name and contains objects Objects – has a key, stores 1 byte - 5G Object key can look like a path ☺ Cost: $0.15/GB-Month $0.10-0.18/GB of data transferred $0.00001 $0.000001/Web $0.00001-$0.000001/Web Service call Data transfers between EC2 and S3 are free of bandwidth charges Buckets and objects can be: Public – accessible by anyone Private – accessible to owner, acl member Chris Richardson — Running Java applications on Amazon EC2 Slide 16
  • 17. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson S3 REST API PUT / HTTP/1.1 Create a bucket Host: <BucketName>.s3.amazonaws.com Authorization: AWS AWSAccessKeyId:Signature … PUT /<ObjectName> HTTP/1.1 Host: <BucketName>.s3.amazonaws.com Authorization: AWS AWSAccessKeyId:Signature Create an item in a bucket … …Bytes… GET /<ObjectName> HTTP/1.1 Host: <BucketName>.s3.amazonaws.com Download an item Authorization: AWS AWSAccessKeyId:Signature … DELETE /<ObjectName> HTTP/1.1 Host: <BucketName>.s3.amazonaws.com Authorization: AWS AWSAccessKeyId:Signature Delete an item … Chris Richardson — Running Java applications on Amazon EC2 Slide 17
  • 18. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Using EC2 and S3 together AMIs are stored in S3 EC2 instances use S3: Use REST API Store database snapshots in S3 Use 3rd party Linux file system that stores data in S3 Store EBS volume snapshots in S3 Chris Richardson — Running Java applications on Amazon EC2 Slide 18
  • 19. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson So what does this mean? For developers Immediate access to many servers Simplified setup Great for testing For deployment Eliminates capital expenses Reduces risk of success catastrophe R d i k f t t h Chris Richardson — Running Java applications on Amazon EC2 Slide 19
  • 20. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Agenda Cloud computing with Amazon EC2 Using Amazon EC2 Overview of Cloud Tools Developing on Amazon EC2 Deploying on Amazon EC2 A few thoughts about Groovy Chris Richardson — Running Java applications on Amazon EC2 Slide 20
  • 21. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Signing up for Amazon Web Services Se ices AWS access identifiers: Account Id Access Id Secret key Private key and certificate Only takes a few minutes Chris Richardson — Running Java applications on Amazon EC2 Slide 21
  • 22. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson EC2 API and Tools SOAP and Query APIs Launch and manage instances etc Amazon provided CLI tools CLI equivalents of APIs AMI creation tools AWS CLI tools from Tim Kay CLI for S3 and EC2 f d Alternatives to Amazon CLI tools ElasticFox a o Awesome Firefox plugin Launch and manage instances Chris Richardson — Running Java applications on Amazon EC2 Slide 22
  • 23. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Using the Query API https://ec2.amazonaws.com/?queryparameters... Mandatory parameters: M d Action – what to do AWSAccessKeyId – your access id Version – API version Timestamp – when request was made Expires – when it expires Signature – digest of parameters and secret key SignatureVersion – set to 1 Other parameters depend on Action Returns an XML document Chris Richardson — Running Java applications on Amazon EC2 Slide 23
  • 24. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Example EC2 requests Action Parameters RunInstances MinCount, MaxCount, ImageId, InstanceType, … TerminateInstances InstanceId.n InstanceId n DescribeInstances InstanceId.n CreateSecurityGroup GroupName, GroupDescription AuthorizeSecurityGroupIngress GroupName, SourceSecurityGroupName, IpProtocol DeauthorizeSecurityGroupIngress h S G … … Chris Richardson — Running Java applications on Amazon EC2 Slide 24
  • 25. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson aws - simple access to EC2 and S3 http://timkay.com/aws/ Easy to use CLI for EC2 and S3 Implemented in Perl Authenticates using access id and secret key stored in ~/.awssecret Chris Richardson — Running Java applications on Amazon EC2 Slide 25
  • 26. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson ElasticFox– ElasticFox Firefox plugin Chris Richardson — Running Java applications on Amazon EC2 Slide 26
  • 27. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Launching instances TIP: launch with a key y pair or else you won't have access Chris Richardson — Running Java applications on Amazon EC2 Slide 27
  • 28. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Creating your own image Easier: Modify an existing AMI y g Launch AMI Configure: e.g. yum install … Harder: Build one from scratch Launch AMI Create a f l to contain OS installation C file ll Mount as a loopback file Install OS: yum –-installroot installroot Use AMI tools to bundle and upload to S3 Chris Richardson — Running Java applications on Amazon EC2 Slide 28
  • 29. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Agenda Cloud computing with Amazon EC2 Using Amazon EC2 Overview of Cloud Tools Developing on Amazon EC2 Deploying on Amazon EC2 A few thoughts about Groovy Chris Richardson — Running Java applications on Amazon EC2 Slide 29
  • 30. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Deploying a web application on EC2 Not rocket science but there are many servers to configure and multiple files to upload Chris Richardson — Running Java applications on Amazon EC2 Slide 30
  • 31. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson What s What's Cloud Tools? Open source project 32 and 64 bit AMIs CentOS 5.10 Apache/Tomcat/MySQL/JMeter/JetS3t installed p y Q EC2Deploy framework Launches instances Configures Tomcat MySQL Apache Tomcat, MySQL, Deploys web applications Runs Jmeter tests Written in Groovy Maven and Grails plugins Quick and easy deployment to EC2 Chris Richardson — Running Java applications on Amazon EC2 Slide 31
  • 32. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson EC2Deploy framework Provides a DSL for describing a cluster: Number of Tomcats, MySQL slaves Database scripts Location of web applications o a o o b app a o Launches EC2 instances Configures MySQL Configures T C fi Tomcat and deploys web dd l b applications Configures Apache to proxy the Tomcat servers Runs JMeter tests Chris Richardson — Running Java applications on Amazon EC2 Slide 32
  • 33. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Example EC2Deploy Script def ec2 = new EC2(…) ClusterSpec clusterSpec = new ClusterSpec() .tomcats(1) .instanceType(EC2InstanceType.SMALL) .slaves(1) .webApp('/home/cer/…/ptrack', quot;ptrackquot;) ebApp('/home/cer/ /ptrack' .catalinaOptsBuilder({optsBuilder, databaseHost, slaves -> optsBuilder.arg(quot;-Xmx500mquot;) optsBuilder.prop(quot;jdbc.db.serverquot;, databaseHost)}) .schema(quot;ptrackquot;, [quot;ptrackquot;: quot;ptrackquot;], [ s c/test/ esou ces/testd [quot;src/test/resources/testdml1.sqlquot;, .sq , quot;src/test/resources/testdml2.sqlquot;]) SimpleCluster cluster = new SimpleCluster(ec2, clusterSpec) cluster.start() cluster.loadTest(quot;/home/cer/…/jmeter/SimpleTest.jmxquot;, [5, 10, 15]) cluster.stop() Chris Richardson — Running Java applications on Amazon EC2 Slide 33
  • 34. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Domain model ClusterSpec <<façade>> SimpleCluster name stop() numberOfTomcats start() numberOfMySqlSlaves loadTest() ... WebApp context Jmeter TomcatServer MySqlServer ApacheServer explodedWar Application uploadToS3() updateTomcat() <<abstract>> Application EC2 EC2Server EC2InstanceState startPolling() waitUntilRunning() instanceId stopPolling() stop() state newServers(n) ssh(command) publicDnsName ... ... privateDnsName Uses Query API to run, terminate Executes ssh and and describe EC2Request scp commands instances Ssh Executor ssh(dns, command, …) executeRequest(params) Chris Richardson — Running Java applications on Amazon EC2 Slide 34
  • 35. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Configuration DSL class ApacheServer extends Application { def configure() { writeFile fileName: quot;$apacheConfDir/cluster.confquot;, templateName: quot;/templates/cluster.confquot;, templateArgs: [tomcats: tomcats] exec quot;$apacheBinDir/apachectl restartquot; waitForHttp port:80, path: tomcats[0].contexts[0] } … class MySqlServer extends Application { } def d f configureAsMaster() { fi A M t () writeFile fileName: quot;/etc/my.cnfquot;, templateName: quot;/templates/master.my.cnfquot; restartService quot;mysqldquot; exec command: quot;mysql -u rootquot;, templateName: quot;/templates/createSchema.sqlquot;, templateArgs: [schemaSpec: schemaSpec] executeSchemaScripts() } } Chris Richardson — Running Java applications on Amazon EC2 Slide 35
  • 36. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Efficiently uploading web applications, etc. applications etc Non-durable disks = upload the entire web application 20+ MBs of jars, etc. Takes a long time (over a DSL connection) Web W b application consists of: li i i f 90% 3rd party libraries – rarely changing 10% application code and content – only some of it changes h Use JetS3t to accelerate uploads Incremental upload of exploded web application to S3 bucket b k Incremental download to Tomcat webapps/ directory First upload is slow but subsequent uploads are fast Chris Richardson — Running Java applications on Amazon EC2 Slide 36
  • 37. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Maven Plugin Goals: • deploy <plugin> • redeploy • stop <groupId>net.chrisrichardson</groupId> <groupId>net chrisrichardson</groupId> • dbsave • dbrestore <artifactId>cloudtools-maven-plugin</artifactId> • jmeter <configuration> <schemaName>ptrack</schemaName> <schemaUsers> <param>ptrack:ptrack</param> </schemaUsers> <catalinaOptsBuilder> { {builder, databasePrivateDnsName -> , builder.arg(quot;-Xmx1000mquot;) builder.prop(quot;jdbc.db.serverquot;, databasePrivateDnsName)} </catalinaOptsBuilder> </configuration> </plugin> mvn cloudtools:deploy Chris Richardson — Running Java applications on Amazon EC2 Slide 37
  • 38. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Grails Plugin Packages E2Deploy as a Grails framework plugin Deploys a Grails application to EC2 $ grails install-plugin <path to plugin> $ grails cloud-tools-deploy g p y Chris Richardson — Running Java applications on Amazon EC2 Slide 38
  • 39. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Agenda Cloud computing with Amazon EC2 Using Amazon EC2 Overview of Cloud Tools Developing on Amazon EC2 Deploying on Amazon EC2 A few thoughts about Groovy Chris Richardson — Running Java applications on Amazon EC2 Slide 39
  • 40. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Collecting pe fo mance metrics performance met ics 70 7000 60 6000 50 5000 40 4000 TPS 30 3000 ART 20 2000 10 1000 0 1 2 4 8 16 32 64 0 R i Requires hardware Time consuming Measure transactions/second (TPS), average response time (ART), utilization, etc. Multiple test runs with different loads, number of servers, etc. Chris Richardson — Running Java applications on Amazon EC2 Slide 40
  • 41. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Load testing with Cloud Tools Runs JMeter with <performanceReport> <cpus>1</cpus> <threads>10</threads> specified number <host> <name>database</name> <cpuUtil>3.2757014224403784</cpuUtil> of threads </host> <host> <name>tomcat0</name> Collects machine <cpuUtil>94.32473318917411</cpuUtil> </host> utilization stats <host> <name>apache</name> <cpuUtil>0.12280614752518504</cpuUtil> p / p </host> Generates reports <host> <name>jmeter</name> <cpuUtil>7.033683910704496</cpuUtil> Executes multiple </host> … <duration>557.943</duration> test runs <tps>10.753786677133686</tps> <art>916.6578333333</art> simultaneously </performanceReport> mvn cloudtools:jmeter -Dcloudtools.thread.count=1,4,8 Chris Richardson — Running Java applications on Amazon EC2 Slide 41
  • 42. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Other kinds of testing Testing failover g Launch cluster Take down servers Test recovery scripts, e.g. MySQL slave- >master Testing database upgrades Launch cluster Install snapshot of production data Apply database migration script Verify that it works y Chris Richardson — Running Java applications on Amazon EC2 Slide 42
  • 43. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Functional testing Tests can be slow, e.g. Web tests Database intensive tests Run tests in parallel on EC2 Multiple test drivers, app servers, DBs Relatively cheap: >$75/hour developer vs. $0.10/hour $0 10/hour machine Selenium Grid from Thoughtworks Open Source framework Runs Selenium web tests in parallel on EC2 Stay tuned for more general solutions Chris Richardson — Running Java applications on Amazon EC2 Slide 43
  • 44. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Building on a fresh machine Debug builds that fail because of a missing dependency Maven dependency Manually installed 3rd party library Build on a fresh EC2 instance Great for open-source projects Chris Richardson — Running Java applications on Amazon EC2 Slide 44
  • 45. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Agenda Cloud computing with Amazon EC2 Using Amazon EC2 Overview of Cloud Tools Developing on Amazon EC2 Deploying on Amazon EC2 A few thoughts about Groovy Chris Richardson — Running Java applications on Amazon EC2 Slide 45
  • 46. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Deploying applications on Amazon Ama on EC2 Great for startups (especially those without a business model) Get up and running ready quickly No upfront hardware costs Scale S l up/down with load /d ith l d Reduces the risk of a success catastrophe Great f enterprises G t for t i No need to wait for corporate IT Use for short-term projects Cloud Computing Survey: IT Leaders See Big Promise, Have Big Security Questions www.cio.com/article/455832/Cloud_Computing_Survey_IT_Leaders_See_Big_Promise_Have_Big_Security_Questi ons Chris Richardson — Running Java applications on Amazon EC2 Slide 46
  • 47. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Issues with AWS Security: Lack of PCI compliance Discomfort with sending customer data to a 3rd party Technology: Not yet suitable for extremely large relational databases Lack of very large machines, e.g. 64G memory Lack of multicast Financials: Cost of bandwidth Steady state costs > your own hardware Chris Richardson — Running Java applications on Amazon EC2 Slide 47
  • 48. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Starter website - $ www.acme.com Elastic IP A EC2 Instance Apache Tomcat MySQL EBS Volume Chris Richardson — Running Java applications on Amazon EC2 Slide 48
  • 49. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Highly available - $$ www.acme.com Elastic IP A Elastic IP B Availability Zone A Availability Zone B Apache Apache Tomcat Tomcat Tomcat Tomcat MySQL MySQL (slave) (Master) EBS Volume Chris Richardson — Running Java applications on Amazon EC2 Slide 49
  • 50. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Batch processing architecture e.g. e g media transcoding Chris Richardson — Running Java applications on Amazon EC2 Slide 50
  • 51. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Easy upgrades Clone production environment Apply upgrades Terminate old instances once you are sure that everything works Chris Richardson — Running Java applications on Amazon EC2 Slide 51
  • 52. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Cloud bursting Host application on your own hardware Use AWS for short-term spikes e g use EC2 instances with slave DBs to e.g. handle read-only requests Periodic batch jobs E.g. content rendering/transformation Chris Richardson — Running Java applications on Amazon EC2 Slide 52
  • 53. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Using AWS in your application o Simple Storage Service (S3) Stores blobs of data St bl b f d t Eg. Photo sharing website Store media Hand out URLs to S3 objects Simple Queue Service (SQS) Hosted queue-based messaging system q g g y Alternative to JMS Loosely coupling between systems SimpleDB Store data sets Execute queries Chris Richardson — Running Java applications on Amazon EC2 Slide 53
  • 54. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Java libraries for AWS JetS3t Rich API for accessing S3 jets3t.dev.java.net/ Typica T i API for SQS, EC2, p SimpleDB code.google.com/p/typica SimpleJPA Subset of JPA on Simple DB code.google.com/p/simplej pa Chris Richardson — Running Java applications on Amazon EC2 Slide 54
  • 55. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Agenda Cloud computing with Amazon EC2 Using Amazon EC2 Overview of Cloud Tools Developing on Amazon EC2 Deploying on Amazon EC2 A few thoughts about Groovy Chris Richardson — Running Java applications on Amazon EC2 Slide 55
  • 56. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson About Groovy Object-oriented, dynamic language Object oriented, Java compatible Runs on the JVM Chris Richardson — Running Java applications on Amazon EC2 Slide 56
  • 57. Getting Groovy code to work Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson can be frustrating Dynamic language = less information for IDE: Limited compile-time checking compile time Limited refactorings Limited completion Chris Richardson — Running Java applications on Amazon EC2 Slide 57
  • 58. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Groovy fans say quot;write unit tests“ BUT BUT… Groovy When you have typos versus Java Chris Richardson — Running Java applications on Amazon EC2 Slide 58
  • 59. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Unit tests don't always catch errors e o s void testPollStatus_discoveringNewServer() { mockEC2RequestExecutor.demand.executeRequst {params -> …. } def mockEC2Server = new MockFor(EC2Server.class) …. mockEC2Server.use { mockEC2RequestExecutor.use { ec2 = new EC2(awsProperties) ec2.pollStatus() public class EC2 { assertEquals 1, ec2.servers.size() } public pollStatus() { } def params = ['Action': } 'DescribeInstances'] def p = requestor.executeRequst(params) requestor executeRequst(params) class EC2RequestExecutor { …. } public Node executeRequest(Map … parameters) { } … } Same typo in test and in code Chris Richardson — Running Java applications on Amazon EC2 Slide 59
  • 60. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Things I like: Java compatible like Ja a import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; class EC2RequestExecutor { Java-like syntax Use Java libraries Log logger = LogFactory.getLog(getClass()) public String calculateRFC2104HMAC(String data, String key) { try { SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(quot;UTF8quot;), HMAC SHA1 ALGORITHM) HMAC_SHA1_ALGORITHM) Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM) mac.init(signingKey) byte[] rawHmac = mac.doFinal(data.getBytes()) return new String(Base64.encodeBase64(rawHmac)) g( ( )) } catch (Exception e) { throw new RuntimeException(quot;Failed to generate HMAC : quot;, e) } } Chris Richardson — Running Java applications on Amazon EC2 Slide 60
  • 61. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Groovy is concise and expressive e p essi e def configureAsMaster() { writeFile fileName: quot;/etc/my.cnfquot;, templateName: quot;/templates/master.my.cnfquot; restartService quot;mysqldquot; exec command: quot;mysql -u rootquot;, templateName: quot;/templates/createSchema.sqlquot;, /templates/createSchema.sql , No parens templateArgs: [schemaSpec: schemaSpec] Keyword parameters executeSchemaScripts() } class TomcatServer { tomcatServer.contexts No N get…() t () def getContexts() { webApps.context } } Chris Richardson — Running Java applications on Amazon EC2 Slide 61
  • 62. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Closures def sortServers(servers) { servers.sort {a, b -> a.instanceId <=> b.instanceId} } public EC2Server findInstance(String instanceId) { def server = servers.find {instanceId == it.instanceId} { } if (server) return server else throw new RuntimeException(….) } Chris Richardson — Running Java applications on Amazon EC2 Slide 62
  • 63. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson XML and GPath expressions <RunInstancesResponse> … <instancesSet> <item> <instanceId>i-4ef21327</instanceId> <imageId>ami-3795705e</imageId> <instanceState> <code>0</code> def client = new HttpClient() <name>pending</name> … </instanceState> def responseStream = <dnsName/> getMethod.getResponseBodyAsStream() getMethod getResponseBodyAsStream() … </RunInstancesResponse> def parser = new XmlParser(false, false) def response = parser.parseText(responseStream) def newServers = response instancesSet item collect { response.instancesSet.item.collect new EC2Server(this, awsProperties, ssh, it.instanceId[0].text(), it.instanceState[0].children()[1].value()[0]) } Chris Richardson — Running Java applications on Amazon EC2 Slide 63
  • 64. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson GStrings and templates def schemaScript = quot;quot;quot; DROP SCHEMA IF EXISTS ${schemaSpec.name}; CREATE SCHEMA ${schemaSpec.name}; quot;quot;quot; String process(String templateName, Map params) { InputStream stream = getClass().getResourceAsStream(templateName) def engine = new groovy.text.SimpleTemplateEngine() engine.createTemplate(new InputStreamReader(stream)).make(params).toString() } … <% contexts.each {%>ProxyPass /$it balancer://mycluster/$it stickysession=jsessionid <%}%> <Proxy balancer://mycluster> <% tomcats.each {%>BalancerMember ajp://${it.hostPrivateDnsName}:8009 route=${it.jvmRoute} min=1 keepalive=On retry=5 <% } %> … Chris Richardson — Running Java applications on Amazon EC2 Slide 64
  • 65. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Builders def report(String path, hosts, cpuCount, threadCount) { def builder = new groovy.xml.MarkupBuilder(new OutputStreamWriter(new FileOutputStream(path))) builder.performanceReport { cpus cpuCount threads threadCount hosts.entrySet().each { hostEntry -> host { name hostEntry.key <performanceReport> cpuUtil hostEntry value getAverageBusy() hostEntry.value.getAverageBusy() <cpus>1</cpus> } <threads>10</threads> } <host> requests { <name>database</name> timings.entrySet().sort{ a, b-> a.key <=> b.key}.each{ pair -> request { <cpuUtil>3.27</cpuUtil> name pair key pair.key </host> art pair.value.average() <host> errors pair.value.errorPercentage() <name>tomcat0</name> } <cpuUtil>94.32</cpuUtil> } } </host> d fd ti V l t tTi ))/1000 0 ((float)(endTime - startTime))/1000.0 def durationValue = ((fl t)( dTi … duration durationValue <duration>557.943</duration> def tpsValue = transactionCount/ durationValue <tps>10.753786677133686</tps> tps tpsValue <art>916.6578333333</art> art averageResponseTime() } </performanceReport> } Chris Richardson — Running Java applications on Amazon EC2 Slide 65
  • 66. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Summary Cloud Computing Immediate access to many servers Pay as you go – no upfront investment/commitment required Easily scale up/down Cloud Tools Easy deployment and testing from Maven and Grails Configure multiple clusters g p Run JMeter tests in parallel Using Groovy Has some nice features Dynamic language features are double-edged sword We need better statically typed languages Chris Richardson — Running Java applications on Amazon EC2 Slide 66
  • 67. Colorado Software Summit: October 19 – 24, 2008 © Copyright 2008, Chris Richardson Final thoughts Download Cloud Tools today: http://code.google.com/p/cloudtools Buy my book ☺ Send email: chris@chrisrichardson.net Visit my website: http://www.chrisrichardson.net Talk to me about consulting and training t i i Chris Richardson — Running Java applications on Amazon EC2 Slide 67