replication

Quick Multi MySQL Server Installation with Master-Master Replication on Same Windows Box

This article is a brief step-by-step tutorial on the subject task which is divided into the following main parts: Installing two MySQL Server Instances Setting up master-slave replication Setting up slave-master replication Let’s begin covering those points… Installing Two MySQL Server Instances on Windows: 1. Install MySQL: Download MySQL Binaries from dev.mysql.com. Install normal MSI Package of mysql. (I used: mysql-essential-5.0.83-win32). * Following MSI Installation is quite easy, proceed and finish the installation. This server will be installed on default 3306 port with all windows default settings. 2. Register/Install another MySQL instance: To have two servers we make sure to...

Replication slave lag monitoring using heartbeat and windows batch scripts

“Show Slave Status” command has a last column “Seconds_Behind_Master”, which gives us idea about how much time slave is lagging behind master. It is an important to be considered parameter in monitoring and maintaining replication. This article explains us a way to monitor replication slave lag time. It also includes a sample batch scripts to automate the monitoring process, makes it easy to understand. Whats wrong with “Seconds_Behind_Master”: Show Slave Status command; does shows us Seconds_Behind_Master. Now Documentation says: The field measures the time difference in seconds between the slave SQL thread and the slave I/O thread. If the network...

MySQL Master Master Replication and auto_increment_increment / auto_increment_offset

In this post we will see importance of replication related variables auto_increment_increment & auto_increment_offset with respect to MySQL Master Master setup. Consider we’ve already set a master-master replication. Now create following table on Server1: `id` int(10) NOT NULL auto_increment, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=latin1; The table will will get replicated on Mysql Server2 in the master-master setup. Now insert value on Mysql Server1 as follows: mysql>insert into temp values(null); On Mysql Server2 in replication you will see single row inserted. Now insert one row from Mysql Server2 as follows: mysql>insert into temp values(null); You should see an...