Quantcast
Viewing all articles
Browse latest Browse all 426

No replication

It is possible to use AutoSlave for one db server (i.e. not using replication).
The reason for doing this, is that AutoSlave provides the transactional safe cache backed.

<?php
$databases
['default']['master'] = array (
 
'database'=> 'mydatabase',
 
'username'=> 'readwrite',
 
'password'=> 'readwrite',
 
'host'=> 'master1',
 
'port'=> '',
 
'driver'=> 'mysql',
 
'prefix'=> '',
);
$databases['default']['default'] = array (
 
'driver'=> 'autoslave',
 
'master'=> array('master'),
 
'slave'=> array('master'),
 
'replication lag'=> 0,
 
'global replication lag'=> FALSE,
);

// Load cache backends
$conf['cache_backends'] = array(
 
'sites/all/modules/memcache/memcache.inc',
 
'sites/all/modules/autoslave/autoslave.cache.inc',
);


else {
 
// Transactional safe memcache
 
$conf['cache_default_class'] = 'AutoslaveCache';
 
$conf['autoslave_cache_default_class'] = 'MemCacheDrupal';
}
?>

Viewing all articles
Browse latest Browse all 426

Trending Articles