List Members,
let me try to explain what I'm trying to set up. I have two servers. Let's call them master.example and slave.example. I've set up MySQL on both, and have replication working from master to slave. Slave is also running MySQL with --read-only.
I've installed MediaWiki on master and have an rsync cron-job syncing the installation to slave. In other words, the MediaWiki on master and slave are *exactly* the same, including LocalSettings.php.
My goal is to have master using it's own database for both reading and writing and slave to use it's own database for reading and masters database for writing. I've set up $wgDBservers like this:
$wgDBservers = array( array( 'host' => 'master.example', 'dbname' => 'wiki', 'user' => 'wiki', 'password' => '********', 'type' => "mysql", 'load' => 0, ), array( 'host' => 'localhost', 'dbname' => 'wiki', 'user' => 'wiki', 'password' => '********', 'type' => "mysql", 'load' => 1, ), );
From the rather limited documentation available about $wgDBservers, it's my understanding that this should result in MediaWiki reading from the MySQL server at localhost and writing to the MySQL server at master.example.
I have also disabled page counters by setting $wgDisableCounters = true;
The problem is, if I stop MySQL on master and reload a page on slave, I get the following error message:
Sorry! This site is experiencing technical difficulties. Try waiting a few minutes and reloading. (Can't contact the database server: Unknown error (master.example))
So my question is; why does a simple page load on slave trigger an attempt to contact the database on master?
In case it's relevant: MediaWiki 1.11.1 on Debian with MySQL 5.0.32.
Bob
Maybe you're using some extension which is directly accessing the master? Keep into mind that some few actions go directly to the master even when they're only for reading, to avoid lag.
Platonides wrote:
Maybe you're using some extension which is directly accessing the master? Keep into mind that some few actions go directly to the master even when they're only for reading, to avoid lag.
Plain install, no extensions. I've also added the following to LocalSettings.php, but the problem persists:
$wgEnableParserCache = false; $wgMainCacheType = CACHE_NONE; $wgMessageCacheType = CACHE_NONE; $wgParserCacheType = CACHE_NONE;
Bob
B. Johannessen wrote:
So my question is; why does a simple page load on slave trigger an attempt to contact the database on master?
Some lookups are *always* done from the master to ensure they are up to date. If the master's not accessible, MediaWiki won't work. (Currently you have to do failover manually.)
-- brion vibber (brion @ wikimedia.org)
mediawiki-l@lists.wikimedia.org