SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Dr Clonelove:
HOW I LEARNED TO STOP WORRYING AND LOVE THE CLOUD




Using Amazon's Elastic Computing Cloud ( and a few too many Star Wars analogies)
to create a scalable server infrastructure for School of Everything.
       David O'Dwyer (SupportFour)
       Peter Brownell (Code Positive / School of Everything)
WHAT'S AHEAD
How we built a server cluster on Amazon EC2 for a Drupal based website.
It's all about how to add and remove servers on the fly.

The set up
Why use the cloud ?
An overview of our server infrastructure

How we got started with the cloud
Some sysadmin religious mumbo-jumbo
General best-practice for any cluster

Technology
The key tools to make it happen




                                                       Image by - http://www.flickr.com/photos/powerpig/
THE SILVER LINING
Why choose the cloud ?
Startups are poor
Pay for servers by the hour
Add a new server in a few minutes
Turn them off when not needed




                                    http://flickr.com/photos/balakov/2468552226
SCALE DOWN
Be able to grow and shrink
The key word really is “Elastic”
Know how you will add and remove new servers




                                     Photo credit: http://www.flickr.com/photos/34558813@N07/
BASIC STRUCTURE
Code built on Drupal
Machine images run Debian Lenny
MySQL database with Replication & MySQL proxy
Many custom scripts
TIME FOR AN EYE TEST
    TIME FOR AN EYE TEST
  TIME FOR AN EYE TEST
TIME FOR AN EYE TEST
THE BIG PICTURE
WHAT WE BUILT
Basic configuration – grow as needed

2 web-servers (small instance)
1 primary database (small instance)
2 slave databases
2 off-cloud machines for monitoring and backups
EVERYONA MAKES MISTAKES
Simple concepts to avoid ultimate disasta
THE END
Work Backwards
Non-persistence – all changes lost on power down
Must be able to rebuild everything - automaticallyish
Start with your plan for complete failure
Make sure you can test your backup system
ULTIMATE FAILURE
Assume that everything may just vanish
Be able to rebuild from backups
Document and blog
Fire Drills – practice makes perfect
CLOUD CITY
Never have faith in just one ally
Set up a base off the cloud
Keep a backup on the ground
Monitor from outside
Mail smarthost to avoid auto greylisting
IT'S A TRAP!
What does it look like –
working or not.

Don't trust anything!
Monitor as much as possible
 - Clues for where problems arise
 - Capacity planning

We use Nagios and Munin.
NOAH'S ARK PRINCIPLE:
Expect the worst and have two of everything
Traditionally expensive
Adding new servers takes time
You may just end up with a lot of hardware doing nothing
                        http://www.thebricktestament.com/genesis/the_flood/gn07_07_10.html
IT'S MUCH EASIER WITH CLONES




   Virtual machines are cheap – but you still need to plan
   Configure one original, and make many copies, in multiple zones
   Only pay for the time you use
   Noah says: “It's not having two of everything running, it's being able to”

                                                      http://www.flickr.com/photos/jeremymates/2362399109/
THE PIECES
Putting the cluster together
STORAGE YOU CAN RELY ON
How safe is your data

Local disk – EC2 Ephemeral Storage (/mnt)
EBS - Elastic Block Store
Point-in-time snapshots
CLONE 2 CLONE
  FILESYSTEM
Avoid dependencies

Local copy of uploaded files
GlusterFS syncs files instantly
Primary webserver uses persistent storage



               Image by - http://www.flickr.com/photos/powerpig/
Gluster File System
SMALLER IS BETTER
                                     MySQL(tm) is MyFriend
                                     Database replication – easy and reliable
                                     Multiple small images as database servers
                                     MySql proxy makes cluster transparent




Best practice guide: http://www.mysql.com/why-mysql/white-papers/mysql_wp_best_practices_mysql_ec2.php

MySQL is a registered trademark of MySQL inc, no it's Sun Microsystems,     http://www.flickr.com/photos/powerpig/
no, woops looks like it's Oracle Inc. now. How weird is that ?
Anyway, we like it, and are happy to endorse them – however owns them.
Image by - http://www.flickr.com/photos/powerpig/




THE BALANCING ACT
Round Robin DNS is the cheap solution for load balancing
Each machine configures dynamic DNS on first startup
Investigating new amazon load balancing
WHAT WE SAID
Cloud infrastructure is not alien, it's just a little less solid – it can grow or shrink.
The cloud forces best practice – no time for slacker sysadmins!

Better safe than sorry
Remember Noah, avoid dependencies
Work backwards – rebuild, restore, backup, operate
Keep a base in the real world
Monitor everything

Managing growth
Loads of local storage, persistent elastic blocks, instant snapshots and S3
Synchronise user uploads with GlusterFS
Scale MySQL with replication and MySQL Proxy
Growing number of load balancing options

Mail
Mail smarthost off-cloud to avoid greylisting




                                                                       Image by - http://www.flickr.com/photos/powerpig/
Want to learn more about Amazon Web Services ?
Sign up on School of Everything and tag yourself with AWS.

        http://schoolofeverything.com/subject/AWS




                     http://schoolofeverything.com/




                              http://supportfour.com
Your humble presenters




The Church of Jar Jar paid a visit to the Star Wars Expo in London. They sang and danced,
the cast all queued up for a picture with us. Then they were thrown out.

Contenu connexe

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Best Practice for getting started with Cloud Computing (EC2, Drupal & MySQL)

  • 1. Dr Clonelove: HOW I LEARNED TO STOP WORRYING AND LOVE THE CLOUD Using Amazon's Elastic Computing Cloud ( and a few too many Star Wars analogies) to create a scalable server infrastructure for School of Everything. David O'Dwyer (SupportFour) Peter Brownell (Code Positive / School of Everything)
  • 2. WHAT'S AHEAD How we built a server cluster on Amazon EC2 for a Drupal based website. It's all about how to add and remove servers on the fly. The set up Why use the cloud ? An overview of our server infrastructure How we got started with the cloud Some sysadmin religious mumbo-jumbo General best-practice for any cluster Technology The key tools to make it happen Image by - http://www.flickr.com/photos/powerpig/
  • 3. THE SILVER LINING Why choose the cloud ? Startups are poor Pay for servers by the hour Add a new server in a few minutes Turn them off when not needed http://flickr.com/photos/balakov/2468552226
  • 4. SCALE DOWN Be able to grow and shrink The key word really is “Elastic” Know how you will add and remove new servers Photo credit: http://www.flickr.com/photos/34558813@N07/
  • 5. BASIC STRUCTURE Code built on Drupal Machine images run Debian Lenny MySQL database with Replication & MySQL proxy Many custom scripts
  • 6. TIME FOR AN EYE TEST TIME FOR AN EYE TEST TIME FOR AN EYE TEST TIME FOR AN EYE TEST
  • 8. WHAT WE BUILT Basic configuration – grow as needed 2 web-servers (small instance) 1 primary database (small instance) 2 slave databases 2 off-cloud machines for monitoring and backups
  • 9. EVERYONA MAKES MISTAKES Simple concepts to avoid ultimate disasta
  • 10. THE END Work Backwards Non-persistence – all changes lost on power down Must be able to rebuild everything - automaticallyish Start with your plan for complete failure Make sure you can test your backup system
  • 11. ULTIMATE FAILURE Assume that everything may just vanish Be able to rebuild from backups Document and blog Fire Drills – practice makes perfect
  • 12. CLOUD CITY Never have faith in just one ally Set up a base off the cloud Keep a backup on the ground Monitor from outside Mail smarthost to avoid auto greylisting
  • 13. IT'S A TRAP! What does it look like – working or not. Don't trust anything! Monitor as much as possible - Clues for where problems arise - Capacity planning We use Nagios and Munin.
  • 14. NOAH'S ARK PRINCIPLE: Expect the worst and have two of everything Traditionally expensive Adding new servers takes time You may just end up with a lot of hardware doing nothing http://www.thebricktestament.com/genesis/the_flood/gn07_07_10.html
  • 15. IT'S MUCH EASIER WITH CLONES Virtual machines are cheap – but you still need to plan Configure one original, and make many copies, in multiple zones Only pay for the time you use Noah says: “It's not having two of everything running, it's being able to” http://www.flickr.com/photos/jeremymates/2362399109/
  • 16. THE PIECES Putting the cluster together
  • 17. STORAGE YOU CAN RELY ON How safe is your data Local disk – EC2 Ephemeral Storage (/mnt) EBS - Elastic Block Store Point-in-time snapshots
  • 18. CLONE 2 CLONE FILESYSTEM Avoid dependencies Local copy of uploaded files GlusterFS syncs files instantly Primary webserver uses persistent storage Image by - http://www.flickr.com/photos/powerpig/
  • 20. SMALLER IS BETTER MySQL(tm) is MyFriend Database replication – easy and reliable Multiple small images as database servers MySql proxy makes cluster transparent Best practice guide: http://www.mysql.com/why-mysql/white-papers/mysql_wp_best_practices_mysql_ec2.php MySQL is a registered trademark of MySQL inc, no it's Sun Microsystems, http://www.flickr.com/photos/powerpig/ no, woops looks like it's Oracle Inc. now. How weird is that ? Anyway, we like it, and are happy to endorse them – however owns them.
  • 21. Image by - http://www.flickr.com/photos/powerpig/ THE BALANCING ACT Round Robin DNS is the cheap solution for load balancing Each machine configures dynamic DNS on first startup Investigating new amazon load balancing
  • 22. WHAT WE SAID Cloud infrastructure is not alien, it's just a little less solid – it can grow or shrink. The cloud forces best practice – no time for slacker sysadmins! Better safe than sorry Remember Noah, avoid dependencies Work backwards – rebuild, restore, backup, operate Keep a base in the real world Monitor everything Managing growth Loads of local storage, persistent elastic blocks, instant snapshots and S3 Synchronise user uploads with GlusterFS Scale MySQL with replication and MySQL Proxy Growing number of load balancing options Mail Mail smarthost off-cloud to avoid greylisting Image by - http://www.flickr.com/photos/powerpig/
  • 23. Want to learn more about Amazon Web Services ? Sign up on School of Everything and tag yourself with AWS. http://schoolofeverything.com/subject/AWS http://schoolofeverything.com/ http://supportfour.com
  • 24. Your humble presenters The Church of Jar Jar paid a visit to the Star Wars Expo in London. They sang and danced, the cast all queued up for a picture with us. Then they were thrown out.