README.md 3.33 KB

cfe-mariadb-cookbook

This installs MariaDB 10.0 by default and initiates databases and users. It can also install a script that performs a backup of all those databases into a designated S3 bucket.

The server is assumed to be using an IAM role with S3 bucket read/write access, instead of a physical credentials file.

Supported Platforms

Ubuntu 14.04

Attributes

Key Type Description Default
['cfe-mariadb']['db_map'] Hash A hash/array of hashes that enumerate the DB names, users, passwords, etc. of all databases to be set up. Please see the default attributes file for examples. {}
['cfe-mariadb']['replication'] Boolean Whether replication is enabled or not false
['cfe-mariadb']['s3_region'] String AWS S3 region 'us-east-1'
['cfe-mariadb']['s3_bucket'] String AWS S3 bucket name 'example-bucket'
['cfe-mariadb']['backup']['cron']['min'] String The backup cronjob 'minute' value '0'
['cfe-mariadb']['backup']['cron']['hour'] String The backup cronjob 'hour' value '0'
['cfe-mariadb']['backup']['cron']['day'] String The backup cronjob 'day of month' value '*'
['cfe-mariadb']['backup']['cron']['mon'] String The backup cronjob 'month' value '*'
['cfe-mariadb']['backup']['cron']['wday'] String The backup cronjob 'day of week' value '*'
['cfe-mariadb']['reload']['aws_access_key_id'] String If not using EC2 roles, enter AWS creds here nil
['cfe-mariadb']['reload']['aws_secret_access_key'] String If not using EC2 roles, enter AWS creds here nil

Usage

cfe-mariadb::default

Include cfe-mariadb in your node's run_list:

{
  "run_list": [
    "recipe[cfe-mariadb]"
  ]
}

cfe-mariadb::backup2s3

This will install the backup script and also enable a cronjob to regularly run that script.

{
  "run_list": [
    "recipe[cfe-mariadb]",
    "recipe[cfe-mariadb::backup2s3]"
  ]
}

cfe-mariadb::reload_from_s3

Kind of the reverse of backup2s3. Download a gzip of a MySQL dump file from an S3 bucket, then load it up into a database. Do this for every database given in node['cfe-mariadb']['db_map'].

This recipe assumes the node is using an EC2 role that can access the given S3 bucket. Otherwise, enter the AWS credentials in node.default['cfe-mariadb']['reload']['aws_access_key_id'] and node.default['cfe-mariadb']['reload']['aws_secret_access_key'].

License and Authors

Author:: Earth U. ()