Coder Social home page Coder Social logo

gox's Introduction

Gox

Painless backup (and restore) tool for MySQL based on xtrabackup from Percona.

Quick start

Install xtrabackup and qpress on MySQL server

See install procedure here for xtrabackup

Once you have installed xtrabackup, install qpress via:

apt-get install qpress

Download gox on our backup server

Get binary from releases page

Rename binary:

mv gox_0.1.0_linux-amd64 gox

Create a config file corresponding to the backup/remote task

See config.yalm.sample

Here is a sample:

# Remote MySQL host
host: mysql.explample.com
# Mysql user
dbuser: root
# Mysql password
dbpassword:
# SSH config
ssh:
  # SSH user
  user: root
  # Private key for ssh user
  key: /home/jdoe/.ssh/id_rsa
# Remote path of xtrabsckup binary
xtrabackup: /usr/bin/xtrabackup
# The number of threads to use to copy multiple data files concurrently when creating a backup
parallel: 2
# Compression 
compress:
  # Compress ?
  active: true
  # This option specifies the number of worker threads used by xtrabackup for parallel data compression
  threads: 2
  # This option when specified will remove .qp, .xbcrypt and .qp.xbcrypt files after decryption and decompression.
  remove-original: true
# This options creates the xtrabackup_galera_info file which contains the local node state at the time of the backup. 
galera: false
# Storage path for backup
backup-dir: /tmp/
# Remove backups older than 'keep' 
# A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix,
# such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
keep: 168h

Backup

gox backup --config /path/to/mysql.host.com.yaml

Restore

gox restore --config /path/to/mysql.host.com.yaml --from 2018-01-31--08-32-49

Support this project

If this project is useful for you, please consider making a donation.

Bitcoin

Address: 1JvMRNRxiTiN9H7LyZTq4yzR7ez86M7ND6

Bitcoin QR code

Ethereum

Address: 0xA84684B45969efbD54fd25A1e2eD8C7790A0C497

ETH QR code

gox's People

Contributors

toorop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gox's Issues

Xtrabackup option have changed

From FredB on https://toorop.fr/post/backup-mysql-gox/

Bonjour (encore moi ^^)
Tout roule depuis que j'ai modifié l'arborescence, je compte donc passer tout ça en production.
Par contre, il semble que la nouvelle version de Xtrabackup (2.4.11) ne fonctionne plus comme l'ancienne (2.4.9 sur mon test).
Le password n'est plus passé comme ça :
--password "mon-password"
mais comme ça :
--password="mon-password"
Gox n'arrive donc plus à fonctionner :
Error: unknown argument: 'mon-password'
unable to run /usr/bin/xtrabackup --backup --stream=xbstream --user backup --password "mon-password" --compress --compress-threads 2

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.