1

I have a DB Server running CentOS 6.4 and MySQL 5.5 from RPMs (not source).

I have dozens of databases but one of them is being hit quite hard with large selects which locks out other updates which in turn locks out other selects (at least I think this is what's happening!)

To alleviate this I would like to replicate one of the databases onto the same server so that the writes can write to the "master" and reads can be done on the "slave". I don't have the luxury of additional hardware.

I have found a lot of guides on the internet describing how to replicate to a different server, and one (http://www.howtoforge.com/one_machine_mysql_replication) describing how to replicate to the same server but it doesn't seem to be geared towards retrofitting this functionality to an existing database with 10s of GB of data in it already. It also talks about compiling MySQL from source.

Does anyone know how I can retrospectively convert my MySQL 5.5 config to replicate one of my databases on the same server?

My existing DB runs on port 3306 so I feel it should be as easy as firing up another instance of MySQL on port 3307 and making some changes to my.cnf but not sure what changes.

Thanks in anticipation.

3
  • Not sure if replicating to the same server would solve the issue or just introduce more. Have you tried to analyse your queries and improve them / index appropriately? Jun 12, 2014 at 10:35
  • You can try using mysqlsandbox.net which allows replication setup on the same host. Once you have tried test setup you can replicate the same on production environment. Jun 13, 2014 at 6:39
  • 1
    In the future, please don't copy the question and re-ask it here, just flag or vote to close as off-topic > belongs on another site on the stack exchange network > dba.se. Jun 20, 2014 at 14:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.