No replication

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

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 backend.

<?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';
}
?>

Help improve this page

Page status: Not set

You can: