séparation de blocs listen en frontend/backend
This commit is contained in:
parent
5e98f2021b
commit
ff8ed1043c
|
@ -3,8 +3,7 @@ title: Howto HAProxy
|
|||
category: web HA
|
||||
---
|
||||
|
||||
* Documentation (txt) : <http://haproxy.1wt.eu/download/1.5/doc/configuration.txt>
|
||||
* Documentation (html) : <https://www.haproxy.com/doc/hapee/1.5/onepage/>
|
||||
* Documentation : <https://www.haproxy.org/#docs>
|
||||
|
||||
[HAProxy](http://www.haproxy.org/) est un puissant *load balancer* pour les protocoles TCP/HTTP/HTTPS. Il gère la répartition de charge et la tolérance de panne. Son principal auteur est [Willy Tarreau](http://1wt.eu/#wami), un développeur actif du noyau Linux. HAProxy est écrit en langage C, il est optimisé pour Linux, mais tourne également sous BSD. Des sites web importants l'utilisent comme Twitter, Github, Reddit, Airbnb, etc.
|
||||
|
||||
|
@ -229,8 +228,12 @@ backend domain2
|
|||
### Exemple en mode TCP
|
||||
|
||||
~~~
|
||||
listen memcached
|
||||
frontend fe_memcached
|
||||
bind 127.0.0.1:11211
|
||||
mode tcp
|
||||
default_backend be_memcached
|
||||
|
||||
backend be_memcached
|
||||
mode tcp
|
||||
option tcp-check
|
||||
server nosql00 192.0.2.3:11211 check
|
||||
|
@ -252,8 +255,12 @@ Il va alors faire une connexion identifiée au serveur MySQL, puis la fermer et
|
|||
Ce mode ne nécessite pas d'outillage supplémentaire et nous le recommandons lorsqu'HAProxy agit seulement comme un proxy et pas comme un load-balancer ou pour de la tolérance de panne.
|
||||
|
||||
~~~
|
||||
listen mysql
|
||||
frontend fe_mysql
|
||||
bind 127.0.0.1:3306
|
||||
mode tcp
|
||||
default_backend be_mysql
|
||||
|
||||
backend be_mysql
|
||||
mode tcp
|
||||
option mysql-check user haproxy_check post-41
|
||||
server sql00 192.0.2.1:3306 check
|
||||
|
@ -270,7 +277,13 @@ CREATE USER haproxy_check@IP_OF_HAPROXY;
|
|||
La version avancée consiste à utiliser un check http pour déterminer l'état du serveur.
|
||||
|
||||
~~~
|
||||
listen mysql 127.0.0.1:3306
|
||||
frontend fe_mysql
|
||||
bind 127.0.0.1:3306
|
||||
mode tcp
|
||||
default_backend be_mysql
|
||||
|
||||
backend be_mysql
|
||||
mode tcp
|
||||
option httpchk HEAD
|
||||
http-check disable-on-404
|
||||
server sql00 192.0.2.1:3306 check port 8306
|
||||
|
|
Loading…
Reference in New Issue