[HyperDB] Active Master and Passive Master with binary replication

Jason Ashdown Jason.Ashdown at futurenet.com
Tue Sep 28 10:19:28 UTC 2010


Hi,

We've been testing out HyperDB for a few weeks now trying to get it work in a particular way.

We wish to have an Active Master (db1) which handles Reads + Writes. We have a Passive Master (db2) that does Read only and keeps up-to-date with binary replication from the Active Master (db1).

As soon as we disable the Active Master (db1) HyperDB spits out errors like "No databases available with wp_4_options (global)".

We've spilt an existing MU database and migrated it to another MU server while using HyperDB for failover.
We are using the latest version of HyperDB.

Our current config, db-config.php (values replaced for security):
// MASTER DATABASE
$wpdb->add_database(array(
            'host'     => 'db1.mysql-server.com',     // If port is other than 3306, use host:port.
            'user'     => 'user',
            'password' => 'password',
            'name'     => 'database',
            'write'    => 1,
            'read'     => 1,
            'dataset'  => 'global',
            'timeout'  => 0.2,
    'charset'  => 'utf8',
    'collate'  => '',
));
// SLAVE DATABASE
$wpdb->add_database(array(
            'host'     => 'db2.mysql-server.com',     // If port is other than 3306, use host:port.
            'user'     => 'user',
            'password' => 'password',
            'name'     => 'database',
            'write'    => 0,
            'read'     => 1,
            'dataset'  => 'global',
            'timeout'  => 0.2,
    'charset'  => 'utf8',
    'collate'  => '',
));

Is there any advice/help that you can give us?

Many thanks,
Jason Ashdown
-- 
Future Publishing Limited (registered company number 2008885) and Future Publishing (Overseas) Limited (registered company number 06202940) are wholly owned subsidiaries of Future plc (registered company number 3757874). Future Publishing Limited, Future Publishing (Overseas) Limited and Future plc are all incorporated in England and Wales and share the same registered address at Beauford Court, 30 Monmouth Street, Bath BA1 2BW.

This email and any files transmitted with it are confidential. If you have received this email in error please notify the sender and then delete it immediately. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Future.

The recipient should check this email and any attachments for the presence of viruses. Future accepts no liability for any damage caused by any virus transmitted by this email.

Future may regularly and randomly monitor outgoing and incoming emails (including the content of them) and other telecommunications on its email and telecommunications systems. By replying to this email you give your consent to such monitoring.

*****

Save resources: think before you print.


More information about the HyperDB mailing list