Getting started on PoolParty
Congrats! You've decided to try out PoolParty, what next? Follow along as we go from zero to done! Time it, let's see how long it takes for you to have a full-blown application up on your cloud!
There are good docs that are updated more frequently on the wiki
Installation
Installing poolparty is simple:
1 gem install auser-poolparty
Make sure you have executed
1 gem sources --add http://gems.github.com
so that rubygems can find the gem.
Bleeding edge install
Grab the code from github:
1 git clone git://github.com/auser/poolparty.git
Make the gem
1 cd poolparty && rake local_deploy
Pool spec
Everything in your pool is defined by your spec file, clouds.rb. This is where all the logic for your cloud will go. You don't have to call it clouds.rb, thats just the default name poolparty looks for. The PoolParty binary commands will look for this clouds.rb file in your current directory, and ~/.poolparty/ as well as your environment's POOL_SPEC variable.
We start out by making a pool.
1 pool :app do 2 endThis doesn't really do anything, but it gives us a convenient wrapper around our clouds. You don't need to define a pool, but it's usually a good idea if the clouds of nodes are going to talk to each other. Properties set in the pool will be inherited by the contained clouds. Now let's make a cloud that actually does something.
1 pool :party do 2 instances 2..5 3 4 cloud :hello do 5 has_file '/etc/motd', :content=>'Welcome to your cloud!' 6 has_file '/var/www/index.html', :content=>"Hello World" 7 end 8 9 endYour cloud is now setup to scale from 2 instances to 5 instances at a maximum. You've defined one cloud (called hello) inside the pool (called party).
From within this cloud block you describe your server setups. There are a quite few built-in Resources you can use here, for instance for a git repository
1 has_git({:name => "poolpartyrepos", 2 :source => "git://github.com/auser/poolparty-website.git", 3 :at => "/var/www/poolpartyrb.com"})or a file
1 has_file(:name => "/var/www/index.html", :content => "<h2>Hello world</h2>")
You can also use plugins plugins and chef recipes in you cloud blocks
1 chef do 2 include_recipes "~/.poolparty/chef/cookbooks/*" 3 recipe "~/.poolparty/chef/rails_recipe.rb" 4 templates "~/.poolparty/chef/templates/" 5 end
Starting your cloud
PoolParty isn't tied to a specific remoter base (i.e. cloud provider.) It can be extended to support anything that provides an api for starting, stopping and listing instances. The default remoter base for PoolParty is ec2.
To get started on ec2, go ahead and check out the Getting started on ec2 tutorial. Don't worry, this tutorial will be here when you get back.
Interacting with your cloud
If you have followed a tutorial from above, then you should be ready to interact with your cloud. Before we start it, we will need to make sure we have a key set for the clouds. Let's make note of what keypairs we have availble by running the command:
1 ec2-describe-keypairs
This will list the keypairs you can use with your clouds. By default PoolParty will use look for a keypair named id_rsa at ~/.ssh/ and ~/.ec2/ and /etc/poolparty.
Now we are ready to play with the cloud!
docs/Cloud Speak
Once you have your pool spec at a comfortable spot, it's time to get your cloud launched.
1 cloud start
- PoolParty will launch your instances
- Configure the instance based on the properties in your manifest
- Install the appropriate software
- Start monitoring the cloud
Now, let's list the cloud and see what instances we have up...
1 cloud list --name hello
Hey! What do you know? It started a new instance for us based on the minimum instances requirement
1 *** Listing cloud app 2 ****** Active instances 3 master 75.101.162.232 4 node1 67.202.61.184
Let's not forget to terminate the clouds so we aren't charged too much for playtime
1 cloud terminate
Note, I left off the --name this time. If you do, it will pick the first cloud. I tend to leave it off when I only have one cloud in my pool.
PoolParty sets up a lightweight communication network and handles the provisioning and load balancing. The master instance is the main connection between your cloud and the rest of the world.
