Ceci est une ancienne révision du document !


Load balancing

Modules apache à activer :

proxy*

Vhost pour le balancer :

<VirtualHost *:80>

ServerName vmnico.lineis.fr
ServerAlias lineis.fr
DocumentRoot /var/www/
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all

</Proxy>
ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/ stickysession=BALANCEID nofailover=Off
ProxyPassReverse / http://node01.lineis.fr/
ProxyPassReverse / http://node02.lineis.fr/
<Proxy balancer://mycluster>
BalancerMember http://node01.lineis.fr  route=node01
BalancerMember http://node02.lineis.fr  route=node02
ProxySet lbmethod=byrequests
</Proxy>

<Location /balancer-manager>
SetHandler balancer-manager
Order deny,allow
Allow from all
</Location>

</VirtualHost>

Vhost pour la node01 :

<VirtualHost *:80>
ServerName node01.lineis.fr
DocumentRoot /var/www
RewriteEngine On
RewriteRule .* - [CO=BALANCEID:balancer.node01:.lineis.fr]
</VirtualHost>

Vhost pour la node02 :

<VirtualHost *:80>
ServerName node02.lineis.fr
DocumentRoot /var/www
RewriteEngine On
RewriteRule .* - [CO=BALANCEID:balancer.node02:.lineis.fr]
</VirtualHost>