amazon web services building blocks for drupal applications and hosting

35
B UILDING T HE C LOUD Jeff Barr, Senior Web Services Evangelist [email protected] @jeEarr

Post on 21-Oct-2014

6.164 views

Category:

Technology


1 download

DESCRIPTION

Cloud computing offers many advantages and challenges for hosting Drupal sites. Acquia Hosting is a highly available cloud-based hosting platform tuned for Drupal performance and scalability. Acquia Hosting built on Amazon Web Services (AWS), takes advantage of an industry leading cloud-computing platform to provide the highest levels of security, fault-tolerance and operational controls possible in the cloud. This Webinar, featuring Barry Jaspan, Senior Architect at Acquia and Jeff Barr, Senior Evangelist Amazon Web Services, discusses how Amazon's Web Services can help Drupal site developers and managers solve common but vexing problems, including scaling. The Elastic Compute Cloud (EC2) components will be discussed in detail. In addition we will discuss specific best practices for: * Creating a high-performance, high-availability Drupal tuned hosting environment on AWS * Load balancing: Elastic IP vs. Elastic Load Balancing * Handling user-uploaded files with multiple web nodes * Achieving true high-availability with multiple availability zones * Choosing between Amazon Relational Database Service and building it yourself * Configuring and managing your cloud servers

TRANSCRIPT

Page 1: Amazon Web Services Building Blocks for Drupal Applications and Hosting

BUILDINGTHECLOUD

JeffBarr,SeniorWebServicesEvangelist

[email protected]

@jeEarr

Page 2: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  IntroduceyoutoAWS

•  Showyouhowthepiecesfittogether•  Providebackgroundforsecondhalfofthiswebinar•  AnsweryourAWSandcloudcompuRngquesRons

GOALSFORTODAY

Page 3: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  AWS=“AmazonWebServices”

•  Oneofourthreebusinesses:–  OnlineRetail–  SellerBusiness(Marketplace)

–  WebServiceInfrastructure

•  PayAsYouGoPricingModel•  TwoLevels:

–  InfrastructureasaService(IaaS)–  Pla_ormasaService(PaaS)

INTRODUCINGAWS

Amazon Web Services

Or “AWS” for short…

Page 4: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  Business

•  Security

•  Presence

•  Technical

BUILDINGTHECLOUD

Page 5: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  Amazon’sBrandName

•  Self‐serveSignup•  UserAccounts•  PayAsYouGo•  CreditCardBilling

BUILDINGTHECLOUD‐BUSINESS

Page 6: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  SecurityisJob#1forUs•  DesignedforMulR‐Tenancy•  SAS70CerRficaRon•  SecurityWhitePaper

–  PhysicalSecurity–  LogicalSecurity

•  PublishedBestPracRces•  hfp://aws.amazon.com/security

BUILDINGTHECLOUD‐SECURITY

Page 7: Amazon Web Services Building Blocks for Drupal Applications and Hosting

BUILDINGTHECLOUD‐PRESENCE

Ashburn,VA/Dallas,TX/LosAngeles,CA/Miami,FL/Newark,NJ/PaloAlto,CA/Seafle,WA/St.Louis,MO/Amsterdam/Dublin/Frankfurt/London/HongKong/Tokyo/Singapore/NewYork

USEast(NorthernVirginia)USWest(NorthernCalifornia)Europe(Dublin)AsiaPacific(Singapore)Moretocome…

AWSRegions:

AWSCloudFrontLocaRons

Page 8: Amazon Web Services Building Blocks for Drupal Applications and Hosting

BUILDINGTHECLOUD‐TECHNICAL

Page 9: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  AmazonEC2:on‐demandcomputepower–  Obtainandbootnewserverinstancesinminutes–  Scalecapacityupordownasneeded–  $0.085perhourandup

•  Keyfeatures:–  SupportforWindows,Linux,andOpenSolaris–  Completeflexibilitytoinstallanyopensourceorcommercialsoqware–  SupportsallmajorwebandapplicaRonpla_orms–  MulRpleAvailabilityZones–  ElasRcIPAddresses–  ElasRcBlockStorage–  ElasRcLoadBalancing–  AutoScaling–  AmazonCloudWatch

AMAZONELASTICCOMPUTECLOUD

Page 10: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  CreateanewrelaRonaldatabasewithoneAPIcall•  OffloadcommonadministraRvetaskstoAWS•  UseexisRngcodeandtools•  ScaleupprocessingorstoragewithoneAPIcall

•  Recoverdatabaseusingsnapshotorlogfile

•  MySQL5.1

AMAZONRELATIONALDATABASESERVICE(RDS)

Page 11: Amazon Web Services Building Blocks for Drupal Applications and Hosting

2010Jan Feb Mar Apr May Jun Jul

»AmazonEC2ReservedInstanceswithWindows,ExtraLargeHighMemoryInstances»AmazonS3VersioningFeature»ConsolidatedBillingforAWS»LowerpricingforOutboundDataTransfer

»AmazonSNS

»SingaporeRegion»RDSinEurope»ELBsessions

AWSPACEOFINNOVATION–2010

»RDSConsoleSupport» S3ReducedRedundancyStorage» RDSMulR‐AZ» CloudFrontStreamingLogs» VPCinEurope

»AWSSoluRonPages

»RDSSSLSupport»CloudWatchEBSMetrics»S3ConsoleSupport»Import/ExportAPI»CloudFrontHTTPSSupport»CloudFrontPOPinNY»CloudFrontPriceReducRon»ElasRcMapReduceupdates

»??»??»??

Page 12: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  AWSTrends:–  ConRnuousinnovaRon–  AddiRonalservices–  AddiRonalfeatures–  AddiRonallocaRons

•  ThisistheRmetolearnandstarttousethecloud!

FINALTHOUGHTS

Page 13: Amazon Web Services Building Blocks for Drupal Applications and Hosting

•  Createdeveloperaccountathfp://aws.amazon.com

•  Downloadaccesskeys,SDKs,developertools

•  BuildanddeployapplicaRon

•  AWSBlog:hfp://aws.typepad.com

GETTINGSTARTEDWITHAWS

Page 14: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Hosting Drupal on AWS

Barry Jaspan Senior Architect, Acquia [email protected] @bjaspan

http://acquia.com/resources/acquia-tv

Page 15: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Acquia Hosting Overview •  Managed web hosting for Drupal

•  High performance, scalability, availability

•  Combined infrastructure- and application-level support from one vendor

•  Single or multi-tier •  Load balancers, web nodes, database clusters,

memcached, network filesystems, ...

•  One instance, separate instances, or any combination

•  Automated •  We provisioned for a “20M uniques on day one”

customer ... in a few minutes.

Page 16: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Load balancing

Page 17: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Load balancing on AWS •  No hardware LB is available

•  Round-robin DNS to web nodes is bad for high-availability

•  Elastic Load Balancer (ELB) •  CNAME requires http://www.TLD

•  Limited flexibility (but now with stickiness!)

•  Elastic IP address (EIP) + software LB •  Allows http://TLD

•  Only one EIP per server

•  We use nginx for LB and Varnish for caching

Page 18: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Software load balancer

Page 19: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Shared !les

Page 20: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

File sharing on AWS •  Drupal needs a POSIX filesystem for user-

uploaded files

•  Elastic Block Store (EBS) is single-instance

•  rsync does not scale past N=2 web nodes

•  S3FS is worse than useless for this •  Too slow, non-POSIX, unreliable, unsupported

•  A network filesystem is required •  NFS?

•  More later...

Page 21: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Basic web stack

Page 22: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

HA load balancer •  Load balancer might fail

•  Elastic IP •  Requires a hot spare

•  EIP must be reassigned to a hot spare

•  Elastic Load Balancer •  For us, can’t talk directly to web nodes

•  nginx provides virtual host flexibility, concurrency protection, etc

•  Varnish provides caching

•  Also requires a hot spare (or second active instance)

Page 23: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

HA load balancer with EIP

Page 24: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

HA !lesystem •  NFS

•  Cannot tolerate server failure

•  Not replicated •  DRBD with virtual IP reassignment won’t work

•  AFS •  Tolerates server failure

•  Not replicated

•  GlusterFS •  Replicated and distributed

•  GPL, commercially supported, under active dev

•  Easy to use, tricky to optimize just right

Page 25: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

HA !lesystem with GlusterFS

Page 26: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

HA database •  Multi-AZ Relational DB Service (RDS)

•  Failover takes 3 minutes

•  Active/passive master MySQL replication •  Must avoid “split-brain” operation

•  All web nodes must fail over simultaneously

•  Heartbeat with virtual IP reassignment not possible

•  Failover mechanism must itself be HA •  Using MySQL proxy just leads to the same problem

•  Requires synchronous app-level failover

•  We store db election in GlusterFS •  Any other HA replicated data store would do

Page 27: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

High-availability web stack

Page 28: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Machine con!g •  All these instances need to be built

•  Incremental custom AMIs •  Time consuming during development/debugging

•  Poor fit for source-code control

•  Leads to mystery configurations

•  Automated configuration scripts/language •  Incremental updates are simple

•  Good fit for source-code control

•  Known process from a clean, base AMI

•  Combining the two may be best

Page 29: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Static con!g with puppet

Page 30: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Elasticity •  Elastic scalability means dynamic

configuration •  Balancers: info on all web nodes

•  Web nodes (Drupal): info on all db servers

•  FS servers: info on all EBS volumes to use

•  FS clients: info on all FS servers to use

•  All (re-)started instances get a new IP •  EIPs are limited and cost more to use

•  All servers need current internal IPs

•  Admins need current external IPs

•  Requires frequent manual updates, or automation

Page 31: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Dynamic data-driven con!g

Page 32: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Email from AWS •  AWS IPs are on many spam blacklists

•  Can’t reliably be used to send mail

•  Requires a non-cloud mail server or service provider

•  Note: Jeff tells me this situation has improved

Page 33: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Colo mail server

Page 34: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Everything else •  I’ve only talked about cloud-specific issues

•  To self-host (anywhere), you also need: •  Backups

•  24x7 monitoring

•  Ops staff

•  Caffeine

•  Ibuprofen

Page 35: Amazon Web Services Building Blocks for Drupal Applications and Hosting

© 2010 Acquia, Inc. Amazon Web Services Building Blocks for Drupal Applications and Hosting

Management and ops stack