Posts

Showing posts from 2014

MySQL Master Master Repliction

This tutorial describes how to set up MySQL master-master replication. We need to replicate MySQL servers to achieve high-availability (HA). In my case I need two masters that are synchronized with each other so that if one of them drops down, other could take over and no data is lost. Similarly when the first one goes up again, it will still be used as slave for the live one. Here  is a basic step by step tutorial, that will cover the mysql master and slave replication and also will describe the mysql master and master replication. Notions:   we will call system 1 as master1 and slave2 and system2 as master2 and slave 1. Step 1: Install mysql on master 1 and slave 1. configure network services on both system, like Master 1/Slave 2 ip: 10.11.218.251 Master 2/Slave 1 ip : 10.11.218.252  Step 2: Setup Master 1 On Master 1, make changes in my.cnf: #vim /etc/my.cnf log-bin=mysql-bin server-id=1 binlog-ignore-db=”mysql” * Restart MySQL Master Service # killall m

MySQL Master Slave Replication

Image
MySQL Master Slave Replication is one way to spread the load across multiple servers.Replication allows you to take one database, make an exact copy of it on another server, and set one of them (the slave) to take all its updates from the other (the master). Its just an one-way communication (Master to Slave), Slave just receiving any event or update from Master, so if Master updated Slave will automaticly updated but if the update did on Slave ofcourse Master is won’t updated. If you want update Multiple Server simultaneously each other, you must try MySQL Master Master Replication. Master address  10.11.218.251 Slave address  10.11.218.252 Setup Master #vim /etc/my.cnf log-bin=mysql-bin server-id=1 binlog-ignore-db=”mysql” * Restart MySQL Master Service # killall mysql mysqld mysqld_safe # mysqld_safe –user=mysql & * Create an user on the Master server that allows replication on the Slave. mysql> GRANT REPLICATION SLAVE ON *.* TO replicator@