Chef cookbook for WAL-E
Ruby Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
attributes
files/default
recipes
templates/default
.gitignore
Cheffile
LICENSE
Makefile
README.org
Vagrantfile
metadata.json
metadata.rb

README.org

wal-e

    __ __
   (O/ \O)
.  ___|___  ,
 \[| ::: |]/
  /\-----/\
 {__}   {__}

Installs WAL-E, an S3 based WAL-shipping disaster recovery and standby toolkit for PostgreSQL. WAL-E will help you sleep at night.

Recipes

The default recipe builds and installs WAL-E. It also configures a runit_service with an environment directory that sets variables useful for running WAL-E. The service doesn’t do anything when run, but a wrapper script is provided to load the environment and run WAL-E commands. This configuration is appropriate for a slave (or for any other system onto which you intend to restore a database).

The cron recipe updates the runit service with a script that runs a full database backup. It also defines a cronjob that executes the backup service task with `sv once` each week. This configuration is appropriate for a database master.

Attributes

This cookbook sets the following default attributes:

attributedescriptiondefault
node['wal-e']['repo']path to Git repositoryhttps://github.com/wal-e/wal-e.git
node['wal-e']['path']source installation path/opt/wal-e
node['wal-e']['bin']executable installation path/usr/local/bin
node['wal-e']['revision']Git revision to deploy(recent master)
node['wal-e']['user']user to run aspostgres
node['wal-e']['data']path to PostgreSQL data directorynode['postgresql']['config']['data_directory']
node['wal-e']['bucket']S3 bucket name(no default)
node['wal-e']['envdir']path to runit environment directory#{node['runit']['service_dir']}/wal-e/env
node['wal-e']['env']Hash of environment variables(see below)

The environment Hash can contain any variables that are useful at WAL-E runtime. For example:

variabledescriptiondefault
TMPpath to temporary directory/tmp
PATHshell $PATH including Python executable
AWS_SECRET_ACCESS_KEYAWS API secret
AWS_ACCESS_KEY_IDAWS API key
WALE_S3_PREFIXS3 paths3://#{node['wal-e']['bucket']}/#{node.name}

The AWS_* variables are not needed if the node WAL-E is running on is configured with an IAM instance profile.

This cookbook also overrides the following attributes used by the postgresql cookbook:

attributedescription
node['postgresql']['recovery']['restore_command']PostgreSQL WAL recovery command (wal-fetch)
node['postgresql']['config']['archive_mode']enable PostgreSQL WAL archival
node['postgresql']['config']['archive_command']PostgreSQL WAL archival command (wal-push)
node['postgresql']['config']['hot_standby']enable PostgreSQL hot standby mode

Requirements

  • Ubuntu 10.04+
  • Python 2.6

Dependencies

  • postgresql
  • libevent
  • build-essential
  • git
  • python
  • runit

License and Author

Author:: Chris Brentano <chris@simple.com>

Copyright:: 2013-, Simple Finance Technology Corp.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.