SlideShare a Scribd company logo
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

Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Amazon Web Services
 
Introduction of Windows azure and overview
Introduction of Windows azure and overviewIntroduction of Windows azure and overview
Introduction of Windows azure and overview
Vishal Tandel
 
Azure Stack Overview
Azure Stack OverviewAzure Stack Overview
Azure Stack Overview
PT Datacomm Diangraha
 
AZ-204T00A-PowerPoint_00.pptx
AZ-204T00A-PowerPoint_00.pptxAZ-204T00A-PowerPoint_00.pptx
AZ-204T00A-PowerPoint_00.pptx
JavierMadrigal29
 
7. 게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
7.	게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...7.	게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
7. 게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
Amazon Web Services Korea
 
Azure ADアプリケーションを使用した認証のあれやこれ
Azure ADアプリケーションを使用した認証のあれやこれAzure ADアプリケーションを使用した認証のあれやこれ
Azure ADアプリケーションを使用した認証のあれやこれ
DevTakas
 
CISベンチマークに対応したiOSのIntune管理
CISベンチマークに対応したiOSのIntune管理CISベンチマークに対応したiOSのIntune管理
CISベンチマークに対応したiOSのIntune管理
Kenta Osuka
 
Boto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うには
Boto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うにはBoto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うには
Boto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うには
Koitabashi Yoshitaka
 
[NEW LAUNCH!] Scaling Tightly-coupled HPC workloads on HPC with Elastic Fabri...
[NEW LAUNCH!] Scaling Tightly-coupled HPC workloads on HPC with Elastic Fabri...[NEW LAUNCH!] Scaling Tightly-coupled HPC workloads on HPC with Elastic Fabri...
[NEW LAUNCH!] Scaling Tightly-coupled HPC workloads on HPC with Elastic Fabri...
Amazon Web Services
 
RenderPool Radeon ProRender for Maya 使い方マニュアル
RenderPool Radeon ProRender for Maya 使い方マニュアルRenderPool Radeon ProRender for Maya 使い方マニュアル
RenderPool Radeon ProRender for Maya 使い方マニュアル
MORGENROTInc
 
Automating nist 800 171 compliance in AWS Govcloud (US)
Automating nist 800 171 compliance in AWS Govcloud (US)Automating nist 800 171 compliance in AWS Govcloud (US)
Automating nist 800 171 compliance in AWS Govcloud (US)
Amazon Web Services
 
Azure Arcの様々なパターンを図で理解する!
Azure Arcの様々なパターンを図で理解する!Azure Arcの様々なパターンを図で理解する!
Azure Arcの様々なパターンを図で理解する!
Masahiko Ebisuda
 
Best practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWSBest practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWS
Amazon Web Services
 
[Cloud OnAir] Google Compute Engine に Deep Dive! 基本から運用時のベストプラクティスまで 2018年7月1...
[Cloud OnAir] Google Compute Engine に Deep Dive! 基本から運用時のベストプラクティスまで 2018年7月1...[Cloud OnAir] Google Compute Engine に Deep Dive! 基本から運用時のベストプラクティスまで 2018年7月1...
[Cloud OnAir] Google Compute Engine に Deep Dive! 基本から運用時のベストプラクティスまで 2018年7月1...
Google Cloud Platform - Japan
 
Keycloakのステップアップ認証について
Keycloakのステップアップ認証についてKeycloakのステップアップ認証について
Keycloakのステップアップ認証について
Hitachi, Ltd. OSS Solution Center.
 
クラウドを最大限活用するinfrastructure as codeを考えよう
クラウドを最大限活用するinfrastructure as codeを考えようクラウドを最大限活用するinfrastructure as codeを考えよう
クラウドを最大限活用するinfrastructure as codeを考えよう
NTT Communications Technology Development
 
Introduction to Google Cloud Platform and APIs
Introduction to Google Cloud Platform and APIsIntroduction to Google Cloud Platform and APIs
Introduction to Google Cloud Platform and APIs
GDSCSoton
 
AWS Lambda ハンズオン 2-Tier アーキテクチャで未来へ
AWS Lambda ハンズオン 2-Tier アーキテクチャで未来へAWS Lambda ハンズオン 2-Tier アーキテクチャで未来へ
AWS Lambda ハンズオン 2-Tier アーキテクチャで未来へ
Amazon Web Services Japan
 
S12_Azure AD 活用術!アプリケーション認証を ADFS から移行しましょう。 [Microsoft Japan Digital Days]
S12_Azure AD 活用術!アプリケーション認証を ADFS から移行しましょう。 [Microsoft Japan Digital Days]S12_Azure AD 活用術!アプリケーション認証を ADFS から移行しましょう。 [Microsoft Japan Digital Days]
S12_Azure AD 活用術!アプリケーション認証を ADFS から移行しましょう。 [Microsoft Japan Digital Days]
日本マイクロソフト株式会社
 
AWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows Powershell
AWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows PowershellAWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows Powershell
AWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows Powershell
Amazon Web Services Japan
 

What's hot (20)

Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
 
Introduction of Windows azure and overview
Introduction of Windows azure and overviewIntroduction of Windows azure and overview
Introduction of Windows azure and overview
 
Azure Stack Overview
Azure Stack OverviewAzure Stack Overview
Azure Stack Overview
 
AZ-204T00A-PowerPoint_00.pptx
AZ-204T00A-PowerPoint_00.pptxAZ-204T00A-PowerPoint_00.pptx
AZ-204T00A-PowerPoint_00.pptx
 
7. 게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
7.	게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...7.	게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
7. 게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
 
Azure ADアプリケーションを使用した認証のあれやこれ
Azure ADアプリケーションを使用した認証のあれやこれAzure ADアプリケーションを使用した認証のあれやこれ
Azure ADアプリケーションを使用した認証のあれやこれ
 
CISベンチマークに対応したiOSのIntune管理
CISベンチマークに対応したiOSのIntune管理CISベンチマークに対応したiOSのIntune管理
CISベンチマークに対応したiOSのIntune管理
 
Boto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うには
Boto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うにはBoto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うには
Boto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うには
 
[NEW LAUNCH!] Scaling Tightly-coupled HPC workloads on HPC with Elastic Fabri...
[NEW LAUNCH!] Scaling Tightly-coupled HPC workloads on HPC with Elastic Fabri...[NEW LAUNCH!] Scaling Tightly-coupled HPC workloads on HPC with Elastic Fabri...
[NEW LAUNCH!] Scaling Tightly-coupled HPC workloads on HPC with Elastic Fabri...
 
RenderPool Radeon ProRender for Maya 使い方マニュアル
RenderPool Radeon ProRender for Maya 使い方マニュアルRenderPool Radeon ProRender for Maya 使い方マニュアル
RenderPool Radeon ProRender for Maya 使い方マニュアル
 
Automating nist 800 171 compliance in AWS Govcloud (US)
Automating nist 800 171 compliance in AWS Govcloud (US)Automating nist 800 171 compliance in AWS Govcloud (US)
Automating nist 800 171 compliance in AWS Govcloud (US)
 
Azure Arcの様々なパターンを図で理解する!
Azure Arcの様々なパターンを図で理解する!Azure Arcの様々なパターンを図で理解する!
Azure Arcの様々なパターンを図で理解する!
 
Best practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWSBest practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWS
 
[Cloud OnAir] Google Compute Engine に Deep Dive! 基本から運用時のベストプラクティスまで 2018年7月1...
[Cloud OnAir] Google Compute Engine に Deep Dive! 基本から運用時のベストプラクティスまで 2018年7月1...[Cloud OnAir] Google Compute Engine に Deep Dive! 基本から運用時のベストプラクティスまで 2018年7月1...
[Cloud OnAir] Google Compute Engine に Deep Dive! 基本から運用時のベストプラクティスまで 2018年7月1...
 
Keycloakのステップアップ認証について
Keycloakのステップアップ認証についてKeycloakのステップアップ認証について
Keycloakのステップアップ認証について
 
クラウドを最大限活用するinfrastructure as codeを考えよう
クラウドを最大限活用するinfrastructure as codeを考えようクラウドを最大限活用するinfrastructure as codeを考えよう
クラウドを最大限活用するinfrastructure as codeを考えよう
 
Introduction to Google Cloud Platform and APIs
Introduction to Google Cloud Platform and APIsIntroduction to Google Cloud Platform and APIs
Introduction to Google Cloud Platform and APIs
 
AWS Lambda ハンズオン 2-Tier アーキテクチャで未来へ
AWS Lambda ハンズオン 2-Tier アーキテクチャで未来へAWS Lambda ハンズオン 2-Tier アーキテクチャで未来へ
AWS Lambda ハンズオン 2-Tier アーキテクチャで未来へ
 
S12_Azure AD 活用術!アプリケーション認証を ADFS から移行しましょう。 [Microsoft Japan Digital Days]
S12_Azure AD 活用術!アプリケーション認証を ADFS から移行しましょう。 [Microsoft Japan Digital Days]S12_Azure AD 活用術!アプリケーション認証を ADFS から移行しましょう。 [Microsoft Japan Digital Days]
S12_Azure AD 活用術!アプリケーション認証を ADFS から移行しましょう。 [Microsoft Japan Digital Days]
 
AWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows Powershell
AWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows PowershellAWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows Powershell
AWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows Powershell
 

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 Cloud
Amazon 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 VPC
GR8Conf
 
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 Web Services
 
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015
Amazon EC2 제대로 사용하기(김상필) - AWS 웨비나 시리즈 2015
Amazon 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 SEED
Matt 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 AWS
Amazon 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 EC2
Chris 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 EC2
Chris 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 AWS
Amazon 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 Dsls
Chris 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 Docker
Amazon 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 Docker
Amazon 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 Ops
Adrian Cockcroft
 
Python on AWS Lambda
Python on AWS Lambda Python on AWS Lambda
Python on AWS Lambda
Amazon Web Services
 
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-april2018
Brendan Bouffler
 
From Monolith to Microservices
From Monolith to MicroservicesFrom Monolith to Microservices
From Monolith to Microservices
Amazon Web Services
 
Netflix in the cloud 2011
Netflix in the cloud 2011Netflix in the cloud 2011
Netflix in the cloud 2011
Adrian Cockcroft
 
ARC205_Born in the Cloud
ARC205_Born in the CloudARC205_Born in the Cloud
ARC205_Born in the Cloud
Amazon Web Services
 
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
Alex 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 2018
Amazon 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 2019
AWS 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 2019
Amazon Web Services
 
Integrating Deep Learning into your Enterprise
Integrating Deep Learning into your EnterpriseIntegrating Deep Learning into your Enterprise
Integrating Deep Learning into your Enterprise
Amazon 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-pattern
Chris 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 patterns
Chris 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.pdf
Chris 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 Architecture
Chris 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 services
Chris 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 application
Chris Richardson
 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate Platform
Chris Richardson
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith
Chris 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

(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
Priyanka Aash
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
maigasapphire
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
CHAPTER-8 COMPONENTS OF COMPUTER SYSTEM CLASS 9 CBSE
CHAPTER-8 COMPONENTS OF COMPUTER SYSTEM CLASS 9 CBSECHAPTER-8 COMPONENTS OF COMPUTER SYSTEM CLASS 9 CBSE
CHAPTER-8 COMPONENTS OF COMPUTER SYSTEM CLASS 9 CBSE
kumarjarun2010
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
Zilliz
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
SynapseIndia
 
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesBLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
SAI KAILASH R
 
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Muhammad Ali
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
Steven Carlson
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
Jimmy Lai
 
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Torry Harris
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
Matthias Neugebauer
 
Data Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining DataData Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining Data
Safe Software
 
Figma AI Design Generator_ In-Depth Review.pdf
Figma AI Design Generator_ In-Depth Review.pdfFigma AI Design Generator_ In-Depth Review.pdf
Figma AI Design Generator_ In-Depth Review.pdf
Management Institute of Skills Development
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
Priyanka Aash
 

Recently uploaded (20)

(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
CHAPTER-8 COMPONENTS OF COMPUTER SYSTEM CLASS 9 CBSE
CHAPTER-8 COMPONENTS OF COMPUTER SYSTEM CLASS 9 CBSECHAPTER-8 COMPONENTS OF COMPUTER SYSTEM CLASS 9 CBSE
CHAPTER-8 COMPONENTS OF COMPUTER SYSTEM CLASS 9 CBSE
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
 
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesBLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
 
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
 
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
 
Data Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining DataData Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining Data
 
Figma AI Design Generator_ In-Depth Review.pdf
Figma AI Design Generator_ In-Depth Review.pdfFigma AI Design Generator_ In-Depth Review.pdf
Figma AI Design Generator_ In-Depth Review.pdf
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
 

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