Opscode Chef for Amazon EC2 - amazon-ec2

I am new to opscode chef. I want to integrate opscode chef in my web application. I have created a node using the web console of opscode on Amazon EC2. Now I want to know that what to do and how to play with cookbooks and other part of chef? I am also unable to connect with the instance i have created on Amazon EC2. I am using the hosted chef server.

After working on Opscode Chef I have found an answer for my question. So, let it be share.
The full documentation is available in the Chef Wiki, which features dedicated guides for various special topics as well, e.g.:
EC2 Bootstrap Fast Start Guide
Fast Start Guide for Windows
Fast Start Guide for Ubuntu
Fast Start Guide for CentOS

Related

Amazon EC2 does not support multicast

I am trying to setup a clustering structure on Amazon EC2 with Wildfly 8.2 . I have tried a lot of things but nothing worked. As learnt Amazon EC2 does not support multicast and this is why I couldn't make it work.
How can I accomplish to setup this structure on Amazon EC2.
Thanks for help.

What are the advantages of using Chef-server with Vagrant v/s Chef-Solo with Vagrant?

I've done some read-up on Vagrant with Chef-Server v/s Vagrant with Chef-solo and have found blogs talking about the usage of the same. I've failed to find anybody summarizing the advantages of either approach. So, here's my question.
I understand that Vagrant cannot spin up virtual machines on a remote machine. This means running "vagrant up" on a particular machine will spin up VMs on that machine alone.
First of all, is this understanding right?
If yes, what’s the point of using a chef server to provision the server?
I feel that if I’m using Vagrant, using chef solo is the way to go and chef
server isn’t adding any value.
Do you think I’m missing something?
Vagrant is used for spin up VMs and you can provision those VMs with the help of chef recipes or via any other provisioning method. https://docs.vagrantup.com/v2/provisioning/index.html
Now, Difference between Chef Server and Chef-Solo:
Chef Server works in Client Server Architecture. You can control or manage all your nodes (VMs launched by Vagrant) with the help of Chef Server. In a particular VM, you can search for other nodes with the help of Chef Server.
Chef-Solo works in Solo mode means, you can provision only single node and you can not get any information about the other nodes. However several techniques exists to overcome such situations like chef-solo-search.

Rackspace/Vagrant: Working with a rackspace vagrant box locally

I was reading through Rackspace's article about using Vagrant with Rackspace open cloud which shows you how you can use a vagrant vm that is hosted on a Rackspace server.
I'm wondering if there's any way that I could work from a vm that is provisioned like a Rackspace server on my local machine via Vagrant. I can't seem to find a box specifically for emulating Rackspace servers and I can't find information on what base OS and basic tools rackspace cloud servers actually use so I could provision my own environment.
Is there a place where I can find a rackspace specific vagrant box or at least find out the os info?
Edit:
Correction, it is possible, but it takes a few steps:
Export (from Rackspace) the image that you want to run locally see here for more info
Download image from Cloud Files
Convert/import the vhd file into VirtualBox see this for example
At this point, you should be able to use that image with Vagrant to run a Rackspace image locally.

Using vagrant on EC2

I need to setup a web server and a database server on EC2.
It should be easy to migrate to another service provider later.
Currently, I have a web server and a database server, each running on separate EC2 micro instances with software installed there remotely.
Can we run a vagrant box on these micro instances with pre-installed and pre-configured softwares like LAMP stack and use that instead. So I will end with 2 vagrant boxes , one for web server another for database server.
Amazon provides already means to copy an instance but it is copied to another EC2 instance only probably .. If there is need to move to some other provider, it will be same process of re-installing all. So, an own virtual box installed on Amazon's virtual box is what i was looking into..
I don't know how good or bad it is.. I doubt if this will affect performance as well. Please share your views. Target is to have env prepared locally and have flexibility to deploy it on any service provider easily.
Running vagrant inside your AWS box is probably not the right solution. Have you looked into the Vagrant AWS provider?
That will allow you to setup and provision your AWS boxes with Vagrant and Puppet or Chef... if you are using Puppet or Chef to provision your servers then you will have a very portable "scripted" install for your servers that can easily be moved to another provider at a later date...
So running a virtual machine, on another virtual machine probably isn't the best. But if you want to install Vagrant on Amazon Linux you can do:
wget https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_x86_64.rpm
sudo rpm -ivh vagrant_2.2.4_x86_64.rpm
The RPM is the Centos version from the downloads page here: https://www.vagrantup.com/downloads.html
But then you cannot install virtualbox to run a VM. So it doesn't actually work anyways.

Replacing Rackspace Cloud SITES with Amazon EC2 Instances

So at work we run a bunch of sites on rackspaces cloud sites platform. This works alright, except I have no way of tweaking anything server side and I find that they sometimes aren't as responsive as they could be.
Let's assume that most of the sites are bloated wordpress installations.
Would it be possible to use EC2 micro instances to host these? (One instance per site)?
I want to move away from rackspace as I have no flexibility with cloud sites and prefer Amazons services.
Sure! You can easily do that!
Sign up for EC2 here.
Go to http://alestic.com/ and chose AMI (Ubuntu AMIs for EC2 drop-down) you want to start instance from.
Start EC2 Micro Instance by hitting the links (or use API Tools). You can use user-data to install desired software on instance start, but I recommend (for simplicity) just to start Instance and install software via terminal using SSH. Follow the dialog and create RSA key to connect your Instance.
Connect to your Instance over ssh using RSA key.
Install software. For example: sudo su, then apt-get update && apt-get install -y ntp php5-fpm nginx wordpress [...].
Create AMI from running Instance with installed and configured software.
Launch more Instances from your own AMI bundled with Wordpress and stuff!
Full disclosure: I am a rackspace employee.
If you want more flexibility than rackspace cloud sites, then you can use rackspace cloud server. You will have all the flexibility of the cloud. If you like the managed part of cloud sites, then i would suggest managed cloud server.

Resources