backend padrão no haproxy

1

Gostaria de saber se existe uma maneira de configurar um back-end padrão no haproxy, por isso ele equilibra as solicitações entre um pool de servidores backend (três no exemplo abaixo), mantendo o back-end padrão como um failover, apenas no caso os três backends principais estão em baixo .

Deve ser algo assim:

  server backend-0 10.10.10.0:3000 check
  server backend-1 10.10.10.1:3100 check
  server backend-2 10.10.10.2:3200 check
  server backend-default 10.10.10.3:3300 check

Eu tentei definir um weight 0 no backend-default, mas isso remove completamente o servidor do algoritmo de balanceamento.

    
por Guido 24.12.2014 / 12:26

1 resposta

1

É um tipo de "backup":

server backend-default 10.10.10.3:3300 check inter 5000 rise 1 fall 3 backup

Do haproxy docs :

Since version 1.1.17, it is possible to specify backup servers. These servers are only sollicited when no other server is available. This may only be useful to serve a maintenance page, or define one active and one backup server (seldom used in TCP mode). To make a server a backup one, simply add the 'backup' option on its line. These servers also support cookies, so if a cookie is specified for a backup server, clients assigned to this server will stick to it even when the other ones come back. Conversely, if no cookie is assigned to such a server, the clients will get their cookies removed (empty cookie = removal), and will be balanced against other servers once they come back. Please note that there is no load-balancing among backup servers by default. If there are several backup servers, the second one will only be used when the first one dies, and so on. To force load-balancing between backup servers, specify the 'allbackups' option.

    
por 24.12.2014 / 13:03