Databases Reference
In-Depth Information
Setting up a test environment
The replication process occurs between at least two instances of the MySQL server.
In production, this normally implies a minimum of two physical servers to procure
these benefits:
• Better performance
• Increased redundancy
However, due to MySQL's configurable port number (the default being 3306),
data directory, and socket, it's possible to have more than one MySQL instance
on the same server. This setup can be configured manually, or via an installation
system such as the MySQL Sandbox. This is an open source project located at
http://mysqlsandbox.net . With this tool, we can set up one or many MySQL
servers very quickly. By using the powerful make_replication_sandbox Linux
shell command, we can install an environment that consists of one master server and
two slave servers. Each server can be started or stopped individually.
The following exercises assume that the MySQL Sandbox has been installed on
your server and that phpMyAdmin's config.inc.php contains a reference to these
Sandbox servers, as shown in the following code block (please adjust the socket
names to your own environment):
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['socket'] = '/tmp/mysql_sandbox25562.sock';
$cfg['Servers'][$i]['verbose'] = 'master';
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['socket'] = '/tmp/mysql_sandbox25563.sock';
$cfg['Servers'][$i]['verbose'] = 'slave1';
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['socket'] = '/tmp/mysql_sandbox25564.sock';
$cfg['Servers'][$i]['verbose'] = 'slave2';
Here, we use the $cfg['Servers'][$i]['verbose'] directive to give a unique
name to each instance, as the real server name is localhost for all of these instances.
Each Sandbox server initially contains two databases: mysql and test .
 
Search WWH ::




Custom Search