Vitor Domingos BOFH
vd Vitor Domingos http://vitordomingos.com
vd Vitor Domingos http://vitordomingos.com BOFH for 10 years with telecom, bank & public administration background
Codebits AWS ground zero: EC2 & S3 hands-on
39º
What I'm not going to talk > AWS account > Install linux, xen or any other tool mentioned > Generate ssh key pairs or manage ssh keys > EC2 for torrents or pr0n > S3 for infinite backups > AWS Security *
What I'm going to talk > Cloud Computing > AWS advantages > EC2; create, upload, manage, backup, assign ip address, available tools > S3; create, manage, put/get, sync, available tools > Bonus
Cloud Computing > grid-utility 2.0 > software as a service 2.0 > clients (firefox) > application (google apps) > platform (google app engine, heroku) > service (openid, mechanical turk, gmaps) > infrastructure > storage
from wikipedia
AWS advantages > Full cloud stack > Cost effective, pay for what you use > Dependable, use it as your work horse > Flexible, scale up or down, on demand > Use the services Luke > Perfect for your codebits projects
Why do you buy and manage hardware? Why are spending your investor money? Werner Vogels, Amazon CTO http://www.allthingsdistributed.com/
Lease, don't buy
SLA?
Yes! But things can fail...
from 9to5
EC2 > hardware on demand > small, large, extra large, high-cpu medium or large > billed by core hour use and bandwidth > fixed ip address > xen based system > runs almost everything (linux, solaris, win)
from amazon docs
EC2 > http://aws.amazon.com > http://sourceforge.net/projects/elasticfox/
EC2 Lingo > AMI; Amazon Machine Image (stored on S3) > Instance; your machine running > Instance Store; limbo > Elastic IP: fixed ip address > SWBF; shutdown without backup and you're fucked > MuKnO; mess up keys and you're out
EC2 command line > ec2-add-keypair ec2-keypair > ec2-describe-images -o self -o amazon > ec2-run-instances <ami_id> -k <keypair-name> > ec2-describe-instances <instance_id> > ec2-authorize default -p {80,22} > ssh -i <private-keyfile> root@<dns_location>
EC2 bundling > install ruby & ami-tools https://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.noarch.rpm > image ec2-bundle-image -i <image_name>.img -k <private_keyfile> \ -c <certificate_file> -u <user_id> > snapshot ec2-bundle-vol -k <private_keyfile> -c <certificate_file> -u <user_id> > upload ec2-upload-bundle -b <bucket> -m image.manifest.xml \ -a <access_key> -s <secret_key> > register ec2-register mybucket/image.manifest.xml
EC2 extra stuff > backup running instance bundle-vol; upload-bundle > assign ip address ec2-associate-address -i <instance_id> > reboot ec2-reboot-instances <instance_id> > terminate (remember SWBF) ec2-terminate-instances <instance_id> > register ec2-register mybucket/image.manifest.xml
EC2 Tools > Amazon AMI Tools > Enomalism > RightScale > ElasticFox > Your own?
S3 > infinite storage > free between EC2 instances > billed by storage, data transfer & requests > unique buckets > up to 5GB per file > metadata and serves itself
S3 lingo > bucket; file containers prtsc/photo.png -> http://prtsc.s3.aws.com/photo.png > objects; fundamental entity, consists of data and metadata > keys; unique identifier for the object > service endpoint; service host and port
S3 do & don'ts > respect restrictions and limitations!!! > don't fuckup access control list for the bucket neither for the object > don't delete unless you're sure > sync; sync; sync > export now & then
S3 > s3sync.net (ruby) > S3 Firefox Organizer > AWS S3 Key + ID
ruby used as curl interface????
S3 command line > s3cmd.rb listbuckets > s3cmd.rb createbucket <name> > s3cmd.rb list <bucket_name> > s3cmd.rb delete <bucket_name> > s3cmd.rb get put <bucket:key> <file> > s3sync.rb -r progress <source> <destination>
S3 tools > thousands, just google it > s3bash FTW > curl > create your own?
AWS is the starbucks of hardware
Bonus!!!! > Xen how-to for freetards saying that AWS is not opensource (PT RMS) > EC2 sandbox > AWS UG
Xen > CentOS (5.2) + xen 3.0.3 > libvirt, lvm, virt-manager > AWS xen kernel xvda vs sda > persistence & time
EC2 sandbox > OpenNebula http://www.opennebula.org > Nimbus http://workspace.globus.org > Haizea http://haizea.cs.uchicago.edu > DTC-Xen http://www.gplhost.com
AWS Portuguese User Group > Why not > Share experiences > Gather up > Workshops > Contact me: vd@7syntax.com > I'll be around