The Network People Solutions for Hosting Providers | ||
NAMEmysql_replicate_manager.pl - Mysql Replication Manager
SYNOPSISA handy tool to help manage replicated MySQL servers.
DESCRIPTIONMatt Simerson, Unix Systems Engineer. I have several clusters of replicated MySQL clusters that I manage. Some are geographically redundant, some are used strictly for load balancing. This script is VERY useful for me and my co-workers. In order to use this program, you must have MATT::Bundle installed. See http://www.tnpi.biz/computing/perl/MATT-Bundle
GrantRun the grant statement necessary to to set up a MySQL master This runs the GRANT query that is necessary for setting up MySQL replication. See http://www.mysql.com/doc/en/Replication_HOWTO.html for more information. It logs into the MySQL master server and executes the command appropriate for the version of MySQL that you are using.
Backup DatabasesUse this option to back up your mysql databases mysql_replicate_manager -b [-d backupdir] The default location for backups is /var/backups/mysql. If you want them stored elsewhere configure then set backupdir = /path/to/backups in your .my.cnf (as shown in the FAQ) or pass it via -d on the command line. You will need to have cronolog, gzip, and mysqldump installed in a "normal" location. Your backups will be stored in a directory based on the date, such as /var/backups/mysql/2003/09/11/mysql_full_dump.gz. Make sure that path is configured to be backed up by your backup software.
DependenciesIn order to use this program, you must have MATT::Bundle installed. See http://matt.simerson.net/computing/perl/
AUTHORMatt Simerson <matt@cadillac.net>
BUGSNone known. Report any to author.
TODOAdd MySQL slave promotion feature Make restoring a failed slave brain dead easy Documentation, documentation, documentation Add commit/rollback support where appropriate check $sth->err and report any premature returns
SEE ALSOhttp://matt.simerson.net/computing/sql/mrm http://matt.simerson.net/computing/sql/mrm/faq.shtml
COPYRIGHTCopyright 2003, Matt Simerson. All Right Reserved.
Last modified on 4/27/05. |
|