mysql

command
v8.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

The `mysql` plugin for SHIELD implements generic backup + restore functionality for a MySQL-compatible server. It can be used against any mysql server compatible with the `mysql` and `mysqldump` tools installed on the system where this plugin is run.

PLUGIN FEATURES

This plugin implements functionality suitable for use with the following SHIELD Job components:

Target: yes
Store:  no

PLUGIN CONFIGURATION

The endpoint configuration passed to this plugin is used to identify what potgres instance to back up, and how to connect to it. Your endpoint JSON should look something like this:

{
    "mysql_host"         : "127.0.0.1",    # optional
    "mysql_port"         : "3306",         # optional
    "mysql_user"         : "username",
    "mysql_password"     : "password",
    "mysql_read_replica" : "hostname/ip",  # optional
    "mysql_database"     : "db",           # optional
    "mysql_options"      : "--quick",      # optional
    "mysql_bindir"       : "/path/to/bin"  # optional
}

Default Configuration

{
    "mysql_host"   : "127.0.0.1",
    "mysql_port"   : "3306",
    "mysql_bindir" : "/var/vcap/packages/shield-mysql/bin"
}

BACKUP DETAILS

If `mysql_database` is not specified in the plugin configuration, the `mysql` plugin makes use of `mysqldump --all-databases` to back up all databases on the mysql server it connects to. Otherwise, it backs up ONLY the specified database. The dumps generated include SQL to clean up existing tables of the databases, so that the restores will go smoothly.

The mysql_options setting can apply mysqldump specific options like --force, --quick and/or --single-transaction

Backing up with the `mysql` plugin will not drop any existing connections to the database, or restart the service.

RESTORE DETAILS

To restore, the `mysql` plugin connects to the mysql server using the `mysql` command. It then feeds in the backup data (`mysqldump` output). Unlike the the `postgres` plugin, this plugin does NOT need to disconnect any open connections to mysql to perform the restoration.

Restoring with the `mysql` plugin should not interrupt established connections to the service.

DEPENDENCIES

This plugin relies on the `mysqldump` and `mysql` utilities. Please ensure that they are present on the system that will be running the backups + restores for postgres. If you are using shield-boshrelease to deploy SHIELD, these tools are provided so long as you include the `agent-mysql` job template along side your `shield agent`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL