NAME
mmmf - multi-master mysql failover
SYNOPSIS
# failover mysql cluster (as configured in /etc/mmmf.conf)
# to the new master SLAVE_ID
#
mmmf --cfg /etc/mmmf.conf --failover-to <SLAVE_ID> [--debug]
CONFIGURATION
Find below sample configuration file, you can copy and adjust it according to your configuration. It should list all of your databases (master and slaves). The file is sourced into mmmf, so you have to respect perl syntax in it.
If the database is local 'sock' option is required, otherwise it can be left empty.
#!/usr/bin/perl
{
package mmmf;
$LOG = "/tmp/mmmf.log";
$db = {
'test1' => {
'host' => "localhost",
'port' => 33001,
'user' => "root",
'pass' => "",
'sock' => "/var/lib/mysql1/mysqld.sock",
'encoding' => "utf8",
},
'test2' => {
'host' => "localhost",
'port' => 33002,
'user' => "root",
'pass' => "",
'sock' => "/var/lib/mysql2/mysqld.sock",
'encoding' => "utf8",
},
'test3' => {
'host' => "localhost",
'port' => 33003,
'user' => "root",
'pass' => "",
'sock' => "/var/lib/mysql3/mysqld.sock",
'encoding' => "utf8",
},
};
}
1;
DESCRIPTION
mmmf is a proof of concept tool implementing mmmf algorithm described here: http://www.nigilist.ru/nit/mmmf/
Please note that currently the tool is a proof of concept only and should not be used in production environment as it does not implement a lot of error and random conditions checking.
CREDITS
Thank you to Yandex team (in alphabetic order):
Andrey Grunau
Dmitry Parfenov
Alexey Simakov
for their ideas and support.
AUTHORS
Petya Kohts <petya@kohts.ru>
COPYRIGHT
Copyright 2011 Petya Kohts.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.