The MySQL 5 Replication Playground

Copyright (C) 2006 Giuseppe Maxia, Stardata s.r.l.
Contact

PURPOSE

This package is a sandbox for testing replication features under MySQL 5.1. It will install four nodes under your home directory, and it will provide some useful commands to start, use and stop each node.

With this package you can play with replication without need of using other computers. The nodes installed in Replication Playground use non-standard ports and sockets, so that they won't interfere with existing MYSQL installations.

REQUIREMENTS

INSTALLATION

Download the latest Replication Playground package.

Unpack the distribution package in one empty directory and run one of the following:

$ ./install.pl --replica_directory=standard_replica standard
or
$ ./install.pl --replica_directory=circular_replica circular

If needed, modify circular_replica.conf or standard_replica.conf to change default installation options.

To see what the installation is doing, either set the "DEBUG" environment variable, or user the --verbose option.

$ DEBUG=1 ./install.pl --replica_directory replication_directory {circular|standard}

Running ./install.pl without options will display a short help

USAGE

Change directory to the newly created one (default: $HOME/circular_replica)

Start all nodes with

./start_all.sh

Start one node with

./start_all.sh {A|B|C|D}

Stop all nodes with

./stop_all.sh

Stop one node with

./stop_all.sh {A|B|C|D}

Stop all nodes and ERASE ALL DATA AND LOGS (WARNING! No questions asked!)

./clear all

(Useful if you mess up with the replication and want to start afresh)

Check replication status with

./check_slaves.sh

use one node:

./a.sh
./b.sh
./c.sh
./d.sh

Execute the same command in all nodes:

./multi_cmd.sh "command"

examples:

./multi_cmd.sh "slave stop"
./multi_cmd.sh "insert into x values (null, 'abc')"
./multi_cmd.sh "select @@server_id"
./multi_cmd.sh "slave start"

DATABASE USERS

There are 6 database users installed by default:

 +-----------------+-------------+-------------------------------+
 |  user name      | password    | privileges                    |
 +-----------------+-------------+-------------------------------+
 |  root@localhost | datacharmer | all on *.* with grant option  |
 |  datacharmer@%  | datacharmer | all on *.*                    |
 |  nodeAuser@%    | nodeApass   | replication slave             |
 |  nodeBuser@%    | nodeBpass   | replication slave             |
 |  nodeCuser@%    | nodeCpass   | replication slave             |
 |  nodeDuser@%    | nodeDpass   | replication slave             |
 +-----------------+-------------+-------------------------------+

PORTS AND SOCKETS

(note: ports can be overriden using -p option during install)

 circular replication
 +------+--------+------------------------+
 | node | port   | socket                 |
 +------+--------+------------------------+
 | A    | 10010  | /tmp/mysql_nodeAc.sock |
 | B    | 10020  | /tmp/mysql_nodeBc.sock |
 | C    | 10030  | /tmp/mysql_nodeCc.sock |
 | D    | 10040  | /tmp/mysql_nodeDc.sock |
 +------+--------+------------------------+

 standard replication
 +------+--------+------------------------+
 | node | port   | socket                 |
 +------+--------+------------------------+
 | A    | 10011  | /tmp/mysql_nodeAs.sock |
 | B    | 10021  | /tmp/mysql_nodeBs.sock |
 | C    | 10031  | /tmp/mysql_nodeCs.sock |
 | D    | 10041  | /tmp/mysql_nodeDs.sock |
 +------+--------+------------------------+

LEGAL NOTICE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA