Sample cookbook using the wal-e-cookbook which installs wal-e (postgres continuous archiving to s3)
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data_bags
nodes
roles
site-cookbooks
.gitignore
Cheffile
Cheffile.lock
Gemfile
Gemfile.lock
LICENSE
README.md
Vagrantfile
solo.rb

README.md

Using WAL-e chef cookbook sample

This cookbook uses the recipes from wal-e-cookbook to install wal-e, continuous archiving of PostgreSQL WAL files to S3.

See /nodes/master.json for sample configuration. WAL-e cookbook requires 3 values to be set

  • aws_secret_access_key
  • aws_access_key_id
  • wale_s3_prefix

See also /nodes/recover.json for bringing up a recovery box. Read more here

It can be used in conjuction with the standard postgresql cookbook or with databox-cookbook. This sample cookbook uses databox.

Recommended reading - wal-e-cookbook README.

See Also: Vagrantfile if you want to try it out locally; make sure to setup your S3 access before booting up the vagrant boxes.

How to use

clone the repo to your local machine - git clone https://github.com/house9/use_wal_e.git

cd into the repo, create a gemset if desired, then:

# install knife-solo and chef-librarian
bundle install

# install the cookbooks defined in Cheffile (NOTE: these are ignored in .gitignore)
librarian-chef install
  • update the attributes in nodes/master.json and nodes/recover.json
  • provision your server:
    • vagrant up if running locally
    • or provision a remote server (DigitalOcean, Linode, AWS, etc)
      • you will need the IP or hostname of the server and a user with root privileges
# replace user and host - i.e. root@192.168.0.0
knife solo prepare user@host --omnibus-version=10.26.0 --node-name=master
# install recipes
knife solo cook user@host nodes/recover.json --no-chef-check

repeat for testing the recovery box

# replace user and host - i.e. root@192.168.0.1
knife solo prepare user@host --omnibus-version=10.26.0 --node-name=recover
# install recipes
knife solo cook user@host nodes/recover.json --no-chef-check

Note

When installing the postgresql chef recipe with chef solo (omnibus) onto ubuntu 12.04, an error can be generated when running postgresql::client - chef_gem("pg") - this error appears to be suppressed, and then compensating actions are taken, most likely resulting in a clean install - see https://github.com/opscode-cookbooks/postgresql/blob/master/recipes/ruby.rb

License

This code released under the MIT License.

See the LICENSE file