Tuesday, November 09, 2004

MySQL replication

Replication: the master writes queries in a binary log that the slave reads and run locally. The replication is asynchronous, and the replication can be filtered and occur at the table level or the database level. In recent (4.x) incarnation of mySQL, reading the binary log and running the queries on the slave are separate tasks for improved performances.

Replication is turned on with the following steps:
  1. A configuration account is created on the slave, binary logs are enable
  2. The master is snapshot and the logs reset
  3. The snapshot is installed on the slave, and replication is configured on the slave
  4. The slave is restarted
Different topologies can be created:
  • In a master/slave topology, the master executes read/write requests. The slave syncs to the master but can also execute read requests
  • In a master/master topology, both execute read/write requests and synchronize mutually.
  • In a load balancing environment, several slaves are used to honor read queries and write queries go to one master the slaves sync to.

0 Comments:

Post a Comment

<< Home

Home