Modifications entre les versions 3 et 4
Version 3 à la date du 2016-09-22 20:59:02
Taille: 2207
Éditeur: LionelValentin
Commentaire:
Version 4 à la date du 2017-04-12 12:18:33
Taille: 2213
Commentaire:
Texte supprimé. Texte ajouté.
Ligne 3: Ligne 3:
=Drupal+HAProxy+MemCached= = Drupal+HAProxy+MemCached =
Ligne 5: Ligne 5:
==Paquet necessaire== == Paquet necessaire ==
Ligne 10: Ligne 10:
==Config pour recuperer le X-Forward-For== == Config pour recuperer le X-Forward-For ==
Ligne 19: Ligne 19:
==AutoSlave (repartition lecture/ecriture)== == AutoSlave (repartition lecture/ecriture) ==
Ligne 71: Ligne 71:
==Memcached== == Memcached ==
Ligne 76: Ligne 76:

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

Drupal+HAProxy+MemCached

Paquet necessaire

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

Config pour recuperer le X-Forward-For

sites/default/settings.php

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

AutoSlave (repartition lecture/ecriture)

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

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

Memcached

apt-get -y install php5-memcache memcached

Module Drupal : https://ftp.drupal.org/files/projects/memcache-7.x-1.5.tar.gz

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