Replication is not working
-
Hello,
Please find below configuration snnipet of db.php file.how to check write query goes to rds maria master database and read query goes to rds read replica.
$wpdb->add_database(array(
‘host’ => ‘masterdatabase’, // If port is other than 3306, use host:port.
‘user’ => ‘xxxxx’,
‘password’ => ‘xxxxxx’,
‘name’ => ‘xxxxxx’,
‘write’ => 1, // master server takes write queries
‘read’ => 0, // … and read queries
));/**
This adds the same server again, only this time it is configured as a slave.
The last three parameters are set to the defaults but are shown for clarity.
*/
$wpdb->add_database(array(
‘host’ => ‘readreplicadbatabase’, // If port is other than 3306, use host:port.
‘user’ => ‘xxxxx’,
‘password’ => ‘xxxxxx’,
‘name’ => ‘xxxxx’,
‘write’ => 0,
‘read’ => 1,
‘dataset’ => ‘global’,
‘timeout’ => 0.2,
));
It would be greatful if you suggest any changes to achieve this.The page I need help with: [log in to see the link]
- The topic ‘Replication is not working’ is closed to new replies.