Patrick Galbraith presented gave an interesting presention titled “Replication for Dummies” at the MySQL Conference today. Previously, I had the notion that replicating servers and creating a master/slave MySQL setup was difficult. However, Patrick had a master/slave, then dual master, then dual master with a slave attached running in under 20 mins. He stepped through the my.cnf properties required for both the master server and the slave server — less than 10 for each!

The gist of how replication works is this:

  1. The master server writes all insert/update statements to a log file while applying them to itself.
  2. The slave server knows about this log file and simply applies each insert/update to itself.
  3. The slave server keeps track of where in the binlog file it last read from, so if the slave goes offline, it can start again from its exact position to get up-to-date.

It doesn’t seem like Patrick has his notes on the MySQLConf2008 wiki yet, but Brian found a nice easy replication howto we can follow instead. I look forward to setting this up for AMPATH and pointing all of our data managers’ read requests to the slave database instead of wasting cycles on the main master database. (that is royal “I” and will actually be either Brian or Simiyu :-P)

This is in the openmrs category tagged as , ,

Add a comment »