MySQL Replica

celeb.inc

Member
Hi, I got the complete technique working. 1 master & 4 slaves.
Now how can I tell XF to use them. Or does it do that automatically. Because my master is very very very busy with 3k users

Could read some already with AdapterClass, etc.. Does anyone know more?
 
For me, therefore, it reaches its limits 🤷🏻‍♂️

How do I need to do it to add multiple db->read? May there be only one db->write? Number them consecutively?

$config['db']['adapterClass'] = 'XF\Db\Mysqli\ReplicationAdapter';
$config['db']['write'] = [
'host' => '192.168.10.1',
// ... username, password, dbname etc.
];
$config['db']['read'] = [
'host' => '192.168.10.2',
// ... username, password, dbname etc.
];
 
For me, therefore, it reaches its limits 🤷🏻‍♂️

How do I need to do it to add multiple db->read? May there be only one db->write? Number them consecutively?

$config['db']['adapterClass'] = 'XF\Db\Mysqli\ReplicationAdapter';
$config['db']['write'] = [
'host' => '192.168.10.1',
// ... username, password, dbname etc.
];
$config['db']['read'] = [
'host' => '192.168.10.2',
// ... username, password, dbname etc.
];
Well I think you can create array of all read db and pass one random within the config. Otherwise I think it's just one write and read.
 
Top Bottom