Log in

View Full Version : MySQL replication


chefy
11-06-2012, 11:43 AM
Hi,

I have configured a slave mysql server and replication is now running. I got it working by the mysql shell. Now I noticed that in config.php there is a section where you can enter the details of your mysql slave server:


// ****** SLAVE DATABASE CONFIGURATION ******
// If you have multiple database backends, this is the information for your slave
// server. If you are not 100% sure you need to fill in this information,
// do not change any of the values here.
$config['SlaveServer']['servername'] = '';
$config['SlaveServer']['port'] = 3306;
$config['SlaveServer']['username'] = '';
$config['SlaveServer']['password'] = '';
$config['SlaveServer']['usepconnect'] = 0;


Should I fill that information? What is the purpose of doing that? Is it intended to distribute the load of my mysql master server to my mysql slave server?

Thanks.

kh99
11-06-2012, 12:25 PM
If you want to enable that feature, you also need to add '_slave' to $config['Database']['dbtype'] (which should be near the top of the file).

I'm not a database admin person, but my understanding is that if you set up the config.php to use a slave, the slave will be used for most "read" operations, which speeds things up because writing and updating causes delays. I could be wrong but I don't believe vbulletin makes any attempt to direct requests to one server or the other to balance the load.