GithubHelp home page GithubHelp logo

docker-xtrabackup's Introduction

Supported tags and respective Dockerfile links

Percona Xtrabackup

Derived from the official Docker Debian Jessie image. The image contains Percona Xtrabackup installed and a simple bash script to run the backup command.

How to use this image?

To run the backup, link it to the running MySQL container and ensure to map the following volumes correctly:

  • MySQL datadir of the running MySQL container: /var/lib/mysql
  • Backup destination: /backups

Example

Suppose you have a MySQL container running named "mysql-server", started with this command:

$ docker run -d \
--name=mysql-server \
-v /storage/mysql-server/datadir:/var/lib/mysql \
-e MySQL_ROOT_PASSWORD=mypassword \
mysql

Then, to perform backup against the above container, the command would be:

$ docker run -it \
-v /storage/mysql-server/datadir:/var/lib/mysql \
-v /storage/backups:/backups \
--rm=true \
gleez/xtrabackup \
sh -c 'exec /xtrabackup.sh'

You should see Xtrabackup output on the screen. Ensure you get the “completed OK” line indicating the backup is successful:

...
innobackupex: Backup created in directory '/backups/2017-02-02_07-00-28'
170202 17:07:57  innobackupex: Connection to database server closed
170202 17:07:57  innobackupex: completed OK!

The container will then exit (the "run" is executed interactively) and automatically removed by Docker since we specified “--rm=true” in the command line. On the machine host, we can see the backups are there:

$ ls -1 /storage/backups/
2017-02-02_07-00-28
2017-01-17_13-07-28
2017-01-17_14-02-50

docker-xtrabackup's People

Contributors

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