Posts

Showing posts with the label ec2

Using Capistrano to Bundle Amazon EC2 Images

Image
Using Capistrano to Bundle Amazon EC2 Images Ive found the following bit of Capistrano script to be useful when tinkering with EC2 images. I can make a change and then bundle the image with just one command: cap admin:bundle The most difficult part of this script was finding out how to upload files to the remote instance using scp . The rest is fairly straightforward. I am only posting this script because I havent seen this functionality posted anywhere else. # capfile for Amazon EC2 Bundling. Normally, a yaml file would be # hold configuration parameters. I am using environment # variables because they are also used by the EC2 # programs - why have the information in two places? # This script assumes that you are only bundling one # instance at a time. # EC2 Instance Hostname to be bundled. ec2_hostname = ENV[BUNDLE_EC2_HOSTNAME] # S3 Bucket Name (where the bundle is uploaded) s3_bucket_name = ENV[BUNDLE_S3_BUCKET_NAME] # If you are using ElasticFox (and if not, why not?) that # you...

Using AWS CLI to create our Cassandra EC2 instance from custom AMI

Using AWS CLI to create our Cassandra EC2 instance from custom AMI Using AWS CLI to create our Cassandra EC2 instance from our custom AMI (Amazon image) Earlier we used packer to create an Amazon Cassandra image - Amazon image (AMI).   Packer installs Cassandra on the AMI. Then we use the AMI to produce Amazon Cassandra EC2 instances. Now we can use that Amazon Cassandra AMI to create an Amazon Cassandra instance.  Packer building Amazon Cassandra AMI We built the Amazon Cassandra image using  packer build  as follows. Building the AWS AMI $ packer build packer-ec2.json After the packer build completes, it will print out the name of the AMI image it created, e.g.,  ami-6db33abc . Now it is time to use the Amazon CLI (aws cli) to create the ec2 instance. Using AWS CLI to create our Cassandra EC2 instance The AWS Command Line Interface is the ultimate utility to DevOp manage your AWS services. �With just one tool to download and configure,...

Using ansible to install Oracle Java on an ec2 box running in the cloud

Using ansible to install Oracle Java on an ec2 box running in the cloud I am writing this down so I dont forget. I started this task but had to stop a few times, and then remember where I left off and at some point, others will need to know how to get started. Install ansible brew install ansible Install Amazon EC2 Ansible integration tool Go here and follow instructions for Amazon EC2 Ansible integration tool. You will run a Python script and setup a few environment variable. It is painless. This will create an ansible inventory file based on your EC2 environment. Start ssh agent with your key $ ssh-agent bash $ ssh-add ~ /.ssh/YOUR_KEY.pem Install ansible Oracle Java install plugin $ ansible-galaxy install ansiblebit.oracle-java Start up an EC2 box tag it as elk=elk However you like, start up an EC2 instance and tag it with the tag elk=elk. This is just the type of box. In this case, I am in the process of writing an ansible setup script for an ELK stack. Test your ansible connec...