Difference between revisions of "Development:TestReplicationSetup"
|
(4 intermediate revisions by 3 users not shown) | |||
| Line 8: | Line 8: | ||
chroot setup is as follows: | chroot setup is as follows: | ||
proc entries are in till's master /etc/fstab to mount the /proc filesystem in the chroots | proc entries are in till's master /etc/fstab to mount the /proc filesystem in the chroots | ||
| − | + | <pre> | |
| + | proc /www/mysql-replication/master/proc proc defaults 0 0 | ||
| + | proc /www/mysql-replication/slave/proc proc defaults 0 0 | ||
| + | </pre> | ||
1) Install the OS files | 1) Install the OS files | ||
<pre> | <pre> | ||
| Line 25: | Line 28: | ||
Master is setup on port 3307, slave on port 3308 | Master is setup on port 3307, slave on port 3308 | ||
| + | on the master, add permission for the replication user: | ||
| + | <pre> | ||
| + | grant replication slave on *.* to repl@localhost | ||
| + | </pre> | ||
| + | |||
| + | on the master, to find the log file / postion variables: | ||
| + | <pre> | ||
| + | flush tables with read lock; | ||
| + | show master status; | ||
| + | </pre> | ||
| + | |||
| + | on the slave, to start replication: | ||
| + | <pre> | ||
| + | change master to master_host = '127.0.0.1', master_port = 3307, master_user='repl', master_log_file = 'mysql-bin.000008', master_log_pos = 13804; | ||
| + | start slave | ||
| + | </pre> | ||
| + | on the master, to enable writes: | ||
<pre> | <pre> | ||
| − | + | unlock tables; | |
</pre> | </pre> | ||
Latest revision as of 01:46, 21 July 2007
On till:
master + slave sub servers, setup as chroot jails.
the chroots live in /www/mysql-replication, under master and slaver servers respectively.
chroot setup is as follows: proc entries are in till's master /etc/fstab to mount the /proc filesystem in the chroots
proc /www/mysql-replication/master/proc proc defaults 0 0 proc /www/mysql-replication/slave/proc proc defaults 0 0
1) Install the OS files
sudo debootstrap --arch amd64 etch /www/mysql-replication/slave http://mirror.xmission.com/debian
2) enter the chrooted system
sudo chroot /www/mysql-replication/master
3) install locales support and MySQL
apt-get install locales-all apt-get install mysql-server-5.0
Master is setup on port 3307, slave on port 3308 on the master, add permission for the replication user:
grant replication slave on *.* to repl@localhost
on the master, to find the log file / postion variables:
flush tables with read lock; show master status;
on the slave, to start replication:
change master to master_host = '127.0.0.1', master_port = 3307, master_user='repl', master_log_file = 'mysql-bin.000008', master_log_pos = 13804; start slave
on the master, to enable writes:
unlock tables;
