Giter Club home page Giter Club logo

docker-mariadb-backup's Introduction

docker-mariadb-backup

This container can be used to periodically backup MySQL, MariaDB, and MariaDB Galera cluster instances.

Example usage which will backup the database every day at 03:00. You can check the last run with the integrated HTTP server on port 18080:

docker run -d \
-v /var/backups:/var/backups \
-p 18080:18080 \
-e TIMEZONE="Europe/Berlin" \
-e SCHEDULE="0 0 3 * *" \
-e BACKUP_METHOD="mysqldump" \
-e BACKUP_OPTS="-u root -p test -h 172.17.0.68" \
hauptmedia/mariadb-backup

Available backup methods

mysqldump

Backups a MySQL/MariaDB database via mysqldump.

Example standalone run:

docker run -i -t --rm \
-v /var/backups:/var/backups \
hauptmedia/mariadb-backup \
backup-mysqldump \
-u root -p test -h 172.17.0.19
Usage: /usr/local/bin/backup-mysqldump -u mysqluser -p mysqlpassword -h mysqlhost

  -u  Specifies the MySQL user (required)
  -p  Specifies the MySQL password (required)
  -h  Specifies the MySQL host (required)
  -P  Specifies the MySQL port (optional)
  -d  Specifies the backup file where to put the backup (default: /var/backups/CURRENT_DATETIME_MYSQLHOST_mysqldump)

galera-xtrabackup-v2

Backups a galera cluster via a remote connection using xtrabackup-v2 sst method.

It creates a listening socket for receiving the state snapshot transfer and launches a galera arbitrator which connects to the cluster, triggers a state snapshot transfer and disconnects from the cluster.

Please note: The donor cluster node must be able to connect to the listen address (which may be specified using the -l option)

Example standalone run:

docker run -i -t --rm \
-v /tmp/mysqlbackup:/var/lib/mysql \
hauptmedia/mariadb-backup \
backup-galera-xtrabackup-v2 \
-a gcomm://172.17.0.19:4567 \
-g MyClusterName 
Usage: /usr/local/bin/backup-galera-xtrabackup-v2 -a gcomm://ip:4567,ip:4567 -g MyClusterName

  -a  Specifies the galera cluster address (required)
  -g  Specifies the galera cluster name (required)
  -l  Specifies the ip and port where to listen for the state snapshot transfer (default: public-ip:4444)
  -d  Specifies the data directory where to put the backup (default: /var/lib/mysql)
  -n  Specifies the donor node which should be use (optional)

docker-mariadb-backup's People

Contributors

hauptmedia avatar

Stargazers

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

Watchers

 avatar  avatar  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.