Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting...
Transcript of Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting...
![Page 1: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/1.jpg)
Licensed under Creative Commons Attribution-Share Alike 3.0 Unported License
Cloud Hosting Practices Lessons DuraSpace has learned
Bill Branan
Open Repositories 2013
![Page 2: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/2.jpg)
Purpose
• Share what we've learned about applications development and hosting in a cloud environment
• Start a conversation about cloud best practices
• Enable more and better use of the cloud
![Page 3: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/3.jpg)
Cloud History
Established 2009 Established 2010
Infrastructure
Demo Site
Established 2009 Demo Site
Established 2010
Established 2012
![Page 4: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/4.jpg)
The Task
• Your goal: Hosted app
• Constraints:
– No local IT support
– Up and running quickly
– Scale with demand
![Page 5: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/5.jpg)
Questions
• Which cloud providers to use?
• Which cloud services to use?
• How to put the pieces together?
• How to handle maintenance?
• How to ensure availability?
• How to scale?
• …
![Page 6: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/6.jpg)
Commercial Cloud
• Available
– No datacenter required
• Flexible
– No up front costs, no contracts
• Lots of options
– AWS, Rackspace, Windows Azure, GoGrid, HP, …
Capabilities of clouds vary greatly
![Page 7: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/7.jpg)
Amazon Web Services
• Clear market leader
– 6x the market share in IaaS as its next closest competitor
• Global
– 9 regions in 6 countries
• Scale
• History of price reductions
• Pace of Growth
![Page 8: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/8.jpg)
EC2
• Elastic Compute Cloud
– Manage server instances
– Amazon Machine Image (AMI)
– Use EBS-based instances
– Use reserved instances
– Use spot instances when possible
– Use elastic IPs
![Page 9: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/9.jpg)
EBS
• Elastic Block Store
– Block-level storage volumes
• Think “hard drive”
• 1 GB - 1 TB
– Best file system storage option for EC2
• Fast and easy to use
• Can be moved between instances
– Not as durable as S3
• Make regular snapshots to S3
![Page 10: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/10.jpg)
Storage
• S3 - Simple Storage Service
– Highly reliable file storage
– Files available for immediate download
– RRS option
• Glacier
– Cheaper than S3
– Same durability as S3
– Takes longer, costs more to get data out
![Page 11: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/11.jpg)
Design
• Stateless
– Applications
– AMIs
• Expect failures
– Unexpected restarts
• Plan to scale
– Horizontal scale: More instances
– Vertical scale: Bigger instances
![Page 12: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/12.jpg)
Pulling it all together
• Building AMIs
• CM Automation
– Consistency
– Repeatability
– Control
• Puppet
– Define + deploy
– Enforce
![Page 13: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/13.jpg)
Testing and Upgrades
• Start from latest EBS snapshot
• Change local /etc/hosts file
• To deploy: Assign elastic IP
![Page 14: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/14.jpg)
Monitoring
• Lots of options
– monitor.us
• Up or Down
– AWS CloudWatch
• Instance monitoring
– New Relic
• Server and application
– Newvem
• Costs, activity, utilization
![Page 15: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/15.jpg)
Accounts
• Use accounts to separate environments:
– Development, Test, Production
– Applications
– Users
• Consolidated billing
– Can complicate reservations
![Page 16: Cloud Hosting Practicesdocs.duraspace.org/documents/OR13-cloud-practices-final.pdf · Cloud Hosting Practices Lessons DuraSpace has learned Bill Branan Open Repositories 2013 . Purpose](https://reader035.fdocuments.net/reader035/viewer/2022070804/5f0340fb7e708231d4084cbe/html5/thumbnails/16.jpg)
We are learning
• Multiple availability zones
• Elastic load balancer
• Autoscaling
– Scale up and down
– Based on metrics (CloudWatch)
– Even for 1 instance
• Use IAM (ID and Access Mgmt)