Introducing DBdeployer

Giuseppe Maxia edited this page Jul 7, 2013 · 7 revisions
Clone this wiki locally

DBdeployer

DBDeployer is a tool that easily installs and helps using MySQL databases, either for testing or production.

Why?

Why do we need such a tool? There are several reasons:

  • If you are testing new database versions, quite often you don't want to use a dedicated server or a resource consumer virtual machine. You want just a new server, deployed in such a way that it does not interfere with existing instances;
  • Not everybody is skilled enough to install a server other than in the default locations, which require root access. And even if you are skilled, there are many times when you don't want to waste your skills on such chores, and simply want the task to be done, possibly instantly and without thinking too much.
  • When you start using a dedicated deployer, your appetite for usage grows. Soon you realize that you can not only deploy a single server, but a whole bunch of them in replication, and you can play with them all the scenarios that would otherwise require expensive dedicated hosts.

What?

What can this deployer do that you can't do on your own? Quite a lot, actually:

  • It can install a database server in seconds, without requiring any input from you, other than which source you want to use (from a tarball, a n already installed server, or from the source you have just compiled).
  • It can easily be scripted to allow deployment of more complex or more fine tuned instances;
  • it can install groups of servers in isolation or in replication;
  • it provides, out of the box, dedicated tools that allow you to use your instances without need for remembering abstruse options;
  • it also allows you to deploy remote instances and eventually to connect them in replication.

How?

Is it difficult to use? Not really.

In its simpler incarnation, it's as easy as

dbdeployer single mysql-5.6.12-osx10.6-x86_64.tar.gz

(will create a single instance)

Or dbdeployer replication mysql-5.6.12-osx10.6-x86_64.tar.gz

(will create three instances: 1 master and two slaves in replication)

Or even

dbdeployer --remote=myremote.com single mysql-5.6.12-osx10.6-x86_64.tar.gz

dbdeployer --remote=myremote1.com,myremote2.com,myremote3.com replication \
   mysql-5.6.12-osx10.6-x86_64.tar.gz

Sample interface

$ dbdeployer
NAME
dbdeployer - installs single and composite MySQL instances

SYNOPSIS
dbdeployer [global options] command [command options] [arguments...]

VERSION
0.0.1

GLOBAL OPTIONS
--help                - Show this message
--hosts=hostname list - Install on one or more remote hosts (default: localhost)
-s, --[no-]sandbox    - Creates a sandboxed or production instance
--version             - Display the program version

COMMANDS
check       - Checks if an instance is working correctly
clone       - Clone an instance
help        - Shows a list of commands or help for one command
move        - Move an instance
multiple    - Deploys a composite instance of isolated servers
remove      - Remove an instance
replication - Deploys a composite instance in replication
single      - Deploys a single instance

Heritage

DBdeployer derives from MySQL Sandbox. They don't have any code in common, but the principles behind MySQL Sandbox are used for DBdeployer.