Drupal Master/Slave Replication I've setup two MySQL servers with Master/Slave replication for the drupal database and I've confirmed the databases are in sync and replicating. 

I am now trying to point drupal to both databases basically for failover/redundancy purposes. That is if I need to reboot our primary database server I don't want our site to go down. (Going read-only is acceptable during failure scenarios)

Based on the following article. I've modified settings.php as follows:

$databases['default']['default'] = array(
  'driver' =&gt; 'mysql',
  'database' =&gt; 'sdrupal',
  'username' =&gt; 'drupal',
  'password' =&gt; 'topsecret',
  'host' =&gt; 'masterdb.ptp.local',
);
$databases['default']['slave'][] = array(
  'driver' =&gt; 'mysql',
  'database' =&gt; 'sdrupal',
  'username' =&gt; 'drupal',
  'password' =&gt; 'topsecret',
  'host' =&gt; 'slavedb.ptp.local',
);


The configuration is fine until I shutdown the master (service mysqld stop) - when I do that my site pukes:


  PDOException: SQLSTATE[HY000] [2013] Lost connection to MySQL server
  at &#039;reading initial communication packet&#039;, system error: 111
  in drupal_is_denied() (line 1895 of /www/includes/bootstrap.inc).
  Additional
  
  PDOException: SQLSTATE[HY000] [2013] Lost connection to MySQL server
  at &#039;reading initial communication packet&#039;, system error: 111
  in dblog_watchdog() (line 141 of /www/modules/dblog/dblog.module).


Whats the trick to make this work?
Regarding Master/Master (High availability) is possible to do load-balancing when no master is down.

The following will make all writes go to master1 and all reads go to master2. If master1 fails, all queries will go to master2. If master2 fails, all queries will go to master1.

'master' =&gt; array('master1', 'master2')
'slave' =&gt; array('master2', 'master1')


The following will make all queries go to master1. If master1 fails all queries will go to master2:

'master' =&gt; array('master1', 'master2')
'slave' =&gt; array('master1', 'master2')