background preloader

Amazon AWS

Facebook Twitter

2010/02/ec2-resize-running-ebs-root. In a previous article I described how to run an EBS boot AMI with a larger root disk size than the default.

2010/02/ec2-resize-running-ebs-root

That’s fine if you know the size you want before running the instance, but what if you have an EC2 instance already running and you need to increase the size of its root disk without running a different instance? As long as you are ok with a little down time on the EC2 instance (few minutes), it is possible to change out the root EBS volume with a larger copy, without needing to start a new instance. Let’s walk through the steps on a sample Ubuntu 9.10 Karmic EBS boot instance. I tested this with ami-6743ae0e but check Alestic.com for the latest AMI ids. On the instance we check the initial size of the root file system (15 GB): $ df -h / Filesystem Size Used Avail Use% Mounted on /dev/sda1 15G 675M 14G 5% / The following commands are all run on a system other than the one we are resizing.

Instanceid=<YOURINSTANCEID> size=20 Stop (not terminate!) Ec2-stop-instances $instanceid while ! Многопоточная закачка файла в S3. Эта статья иллюстрирует реальное применение и получение выигрыша в производительности на примере закачки файлов в хранилище Amazon S3 с использованием многопоточности на языке Ruby с использованием gem aws-sdk.

Многопоточная закачка файла в S3

Начнем с простого Реализовать закачку файла при помощи официального (т.е. разрабатываемого Amazon) gem aws-sdk достаточно просто. Если опустить подготовительную часть формирования параметров авторизации Amazon Web Services (AWS), то код занимает три строки: def upload_to_s3(config, src, dst) s3 = AWS::S3.new( :access_key_id => config['access_key_id'], :secret_access_key => сonfig['secret_access_key']) s3_file = s3.buckets[config['bucket_name']].objects[dst] s3_file.write(:file => src, :acl => :public_read) end Метод работает и показывает среднюю скорость закачки до 5Мб/c на файлах, больших 5Мб (на меньших файлах средняя скорость падает).

Закачка файла частями Для закачки файла частями в aws-sdk существуем метод multipart_upload. На вид получается посложнее, чем простая закачка. How to create an Amazon Elastic Compute Cloud EC2 Machine Image (AMI) This how to article will go over creating a Amazon Elastic Compute Cloud (EC2) Machine Image (AMI) from scratch.

How to create an Amazon Elastic Compute Cloud EC2 Machine Image (AMI)

In this particular example we are creating a Centos 5.3 64bit AMI from beginning to end. For those that are interested in taking advantage of cloud computing, hopefully you find this blog article helpful. Note this blog also can be generalized for Centos 5, 5.1, 5.2 most versions of Redhat, and Fedora 64bit and 32bit. First thing is first you are going to need to sign up for an Amazon Web Services account specifically S3 Storage and EC2 Elastic Compute Cloud here.

You will need a credit card and some basic info, and will immediately get the following info: AWS Account Number S3 KEY "yourkeynumber" S3 SECRET KEY "yoursecretkey" EC2 PRIVATE KEY "pk-yourprivatekey.pem" EC2 CERTIFICATE "cert-yourcertificate.pem" Time to login become root and go to town: Put your two .pem files the cert and pk in the directory ~/.ec2 [root@server]$ mkdir ~/.ec2 Enable your .bashrc settings.