MySQL Data Replication

Synopsis

Basic MYSQL Database Replication

Description

True HA installations involving databases require redundancy of the database serving itself. Large installations may require MySQL Cluster,
however, smaller installations can get away with simply circular MySQL replication. This page will show you how to configure two nodes to replicate
all information between each other. Both nodes are writeable and when the replication is severed, they will resync once replication is restored. There
is also a patch available to split up reading and writing up to seperate servers, spreading out load on the database.

MySQL Node 1:


/etc/my.cnf

[mysqld]
log-bin
server-id = 1
master-host = mysql-2.whatever.com
master-user = root
master-password = stellance
relay-log = mysql-2-relay-bin
auto_increment_increment = 2
auto_increment_offset = 1

MySQL Node 2:


/etc/my.cnf

[mysqld]
log-bin
server-id = 2
master-host = mysql-1.whatever.com
master-user = root
master-password = stellance
relay-log = mysql-1-relay-bin
auto_increment_increment = 2
auto_increment_offset = 2


See also

Synopsis

Basic MYSQL Database Replication

Description

True HA installations involving databases require redundancy of the database serving itself. Large installations may require MySQL Cluster,
however, smaller installations can get away with simply circular MySQL replication. This page will show you how to configure two nodes to replicate
all information between each other. Both nodes are writeable and when the replication is severed, they will resync once replication is restored. There
is also a patch available to split up reading and writing up to seperate servers, spreading out load on the database.

MySQL Node 1:


/etc/my.cnf

[mysqld]
log-bin
server-id = 1
master-host = mysql-2.whatever.com
master-user = root
master-password = stellance
relay-log = mysql-2-relay-bin
auto_increment_increment = 2
auto_increment_offset = 1

MySQL Node 2:


/etc/my.cnf

[mysqld]
log-bin
server-id = 2
master-host = mysql-1.whatever.com
master-user = root
master-password = stellance
relay-log = mysql-1-relay-bin
auto_increment_increment = 2
auto_increment_offset = 2


See also

Created by: stellance, Last modification: Sat 28 of Oct, 2006 (16:39 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+