Skip to content
This repository was archived by the owner on May 30, 2018. It is now read-only.
This repository was archived by the owner on May 30, 2018. It is now read-only.

Replication is not properly working. #1

@jaydip189

Description

@jaydip189

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions