XF 2.1 Writing to 2 databases does not work

Academic

Member
Hi!

Following these instructions: https://xenforo.com/community/threads/suggestion-mysql-read-slave-write-master.14492/post-1173474

Writing to 2 databases does not work, the data is being inserted into one only. Any idea what can be the cause? Thanks!

Code:
$config['db']['adapterClass'] = 'XF\Db\Mysqli\ReplicationAdapter';

$config['db']['write'] = [
    'host' => 'localhost',
    'port' => '3306',
    'username' => 'user',
    'password' => 'pass',
    'dbname' => 'db',
];

$config['db']['write'] = [
    'host' => 'localhost',
    'port' => '3306',
    'username' => 'user',
    'password' => 'pass',
    'dbname' => 'db2',
];

$config['db']['read'] = [
    'host' => 'localhost',
    'port' => '3306',
    'username' => 'user',
    'password' => 'pass',
    'dbname' => 'db',
];
 
Back
Top Bottom