Modifications entre les versions 1 et 2
Version 1 à la date du 2016-09-22 13:08:48
Taille: 64
Éditeur: LionelValentin
Commentaire:
Version 2 à la date du 2016-09-22 13:12:00
Taille: 2073
Éditeur: LionelValentin
Commentaire:
Texte supprimé. Texte ajouté.
Ligne 3: Ligne 3:
DrupalHAProxyMemCached Drupal+HAProxy+MemCached


apt-get install apache2 haproxy php5 php5-gd php5-durl libssh2-php

sites/default/settings.php

$conf['reverse_proxy'] = TRUE;
$conf['reverse_proxy_addresses'] = array('10.242.1.194','10.242.1.195');

AutoSlave :


wget https://ftp.drupal.org/files/projects/autoslave-7.x-1.8.tar.gz


mv autoslave /var/www/html/sites/all/modules/

chown -R www-data:www-data /var/www/html/sites/all/modules/autoslave/

cd /var/www/html/

cp -r sites/all/modules/autoslave/autoslave includes/database/

chown -R www-data:www-data includes/database/autoslave/

$databases['default']['default'] = array (
  'driver' => 'autoslave',
  'master' => array('master', 'autoslave'), // Fallback to slaves if master fails (read-only mode)
  'slave' => array('autoslave', 'master'), // Fallback to master if slaves fail
  'affected tables backend' => 'autoslave.affected_tables.memcache-db-accurate.inc',
  'watchdog on shutdown' => TRUE,
  'replication lag' => 2,
);

$databases['default']['master'] = array (
  'database' => 'drupal',
  'username' => 'auf',
  'password' => 'XXXXXXXXXXXXXXXXXXXXXXX',
  'host' => 'prod-db-master-idneuf',
  'port' => '',
  'driver' => 'mysql',
  'prefix' => '',
);

$databases['default']['autoslave'] = array (
  'database' => 'drupal',
  'username' => 'haproxy_auf',
  'password' => 'XXXXXXXXXXXXXXXXXXXXXX',
  'host' => '127.0.0.1',
  'port' => '',
  'driver' => 'mysql',
  'prefix' => '',
  'readonly' => TRUE, // Required for system to enter "readonly" mode if master fails.
  'tables' => array('sessions', 'semaphore', 'watchdog', 'users', 'history'),
);

// Use locking that supports force master
$conf['lock_inc'] = 'sites/all/modules/autoslave/memcache-lock.inc';

// Use AutoSlave transactional safe cache wrapper with a memcache backend
$conf['cache_backends'][] = 'sites/all/modules/autoslave/autoslave.cache.inc';
$conf['cache_default_class'] = 'AutoslaveCache';
$conf['autoslave_cache_default_class'] = 'MemCacheDrupal';

Rédiger « OVH/VPC02/idneuf » ici.

Drupal+HAProxy+MemCached

apt-get install apache2 haproxy php5 php5-gd php5-durl libssh2-php

sites/default/settings.php

$conf['reverse_proxy'] = TRUE; $conf['reverse_proxy_addresses'] = array('10.242.1.194','10.242.1.195');

AutoSlave :

wget https://ftp.drupal.org/files/projects/autoslave-7.x-1.8.tar.gz

mv autoslave /var/www/html/sites/all/modules/

chown -R www-data:www-data /var/www/html/sites/all/modules/autoslave/

cd /var/www/html/

cp -r sites/all/modules/autoslave/autoslave includes/database/

chown -R www-data:www-data includes/database/autoslave/

$databases['default']['default'] = array (

  • 'driver' => 'autoslave', 'master' => array('master', 'autoslave'), // Fallback to slaves if master fails (read-only mode) 'slave' => array('autoslave', 'master'), // Fallback to master if slaves fail 'affected tables backend' => 'autoslave.affected_tables.memcache-db-accurate.inc', 'watchdog on shutdown' => TRUE, 'replication lag' => 2,

);

$databases['default']['master'] = array (

  • 'database' => 'drupal', 'username' => 'auf', 'password' => 'XXXXXXXXXXXXXXXXXXXXXXX', 'host' => 'prod-db-master-idneuf', 'port' => , 'driver' => 'mysql', 'prefix' => ,

);

$databases['default']['autoslave'] = array (

  • 'database' => 'drupal', 'username' => 'haproxy_auf', 'password' => 'XXXXXXXXXXXXXXXXXXXXXX', 'host' => '127.0.0.1', 'port' => , 'driver' => 'mysql', 'prefix' => , 'readonly' => TRUE, // Required for system to enter "readonly" mode if master fails. 'tables' => array('sessions', 'semaphore', 'watchdog', 'users', 'history'),

);

// Use locking that supports force master $conf['lock_inc'] = 'sites/all/modules/autoslave/memcache-lock.inc';

// Use AutoSlave transactional safe cache wrapper with a memcache backend $conf['cache_backends'][] = 'sites/all/modules/autoslave/autoslave.cache.inc'; $conf['cache_default_class'] = 'AutoslaveCache'; $conf['autoslave_cache_default_class'] = 'MemCacheDrupal';

OVH/VPC02/idneuf (dernière édition le 2017-04-12 12:20:03 par JeanChristopheAndré)