Giter Club home page Giter Club logo

s3backup's Introduction

s3backup

Stream MySQL Backups to AWS S3.

Prerequisites

  • s3gof3r

    s3gof3r provides fast, parallelized, pipelined streaming access to Amazon S3. It includes a command-line interface: gof3r

  • xtrabackup >= 2.3

    Percona XtraBackup is an open-source hot backup utility for MySQL - based servers that doesn’t lock your database during the backup.

Configuration

Copy s3backup.cnf.example to /etc/s3backup.cnf or ~/.s3backup.cnf and edit it accordingly

Set AWS S3 Bucket Name to store backups

S3_BUCKET_NAME='my_bucket'

Set AWS S3 Bucket path to store backups. This is useful if you want to store all this backups in a dedicated directory

S3_BACKUP_PATH='databases'

Set Backup path to store backups, e.g cluster_name

S3_BACKUP_NAME='cluster_name'

MySQL User user when running a backup.

MYSQL_USER='root'

MySQL User password user when running a backup.

MYSQL_PASSWORD='root'

Command to start mysql, based on your distro.

MYSQL_SERVICE_CMD="service mysql start"

Directory used to restore the backup. If you are using full-restore set this to MySQL datadir otherwise set this to a temporal directory.

LOCAL_DIR='/tmp/restore_db'

AWS Region where S3 Bucket is located

AWS_REGION='s3-us-west-2.amazonaws.com'

AWS Access key

export AWS_ACCESS_KEY_ID='YOUR_AWS_ACCESS_KEY_ID'

AWS Secret key

export AWS_SECRET_ACCESS_KEY='YOUR_AWS_SECRET_ACCESS_KEY'

Usage

Generate the AES256 key for backups encryption

s3backup genkey

Upload a full backup to S3 Bucket

s3backup backup

Prepare a full backup restore from S3 Bucket from desired date in format 'YYYYMMDD'. This will leave a restore ready to run innobackupex --move-back DIR

s3backup restore date

Restore a full backup from S3 Bucket from disered date in format 'YYYYMMDD'. Set LOCAL_DIR to MySQL datadir, make sure this directory is empty and MySQL Service is not running.

s3backup full-restore date

References

s3backup's People

Contributors

abednarik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.