0

I have configured two application servers with HA Proxy to recover from fail-over situation. So I want to configure HA in such a way that if my 1st application server goes down, then only next requests forward to 2nd server, otherwise 2nd server must be seat as ideal only. I know that I am trying to disable actual purpose of HA Proxy, but that's what my requirement. My 2nd server is busy with other jobs and will help to serve request only if 1st server crashed. I will loose all sessions from 1st server but that is OK for me.

Is it possible through HA Proxy configurations? Please let me know.

Navnath
  • 135
  • 1
  • 5

1 Answers1

0

Well obviously you didn't bother to read the manual, because the option to do so is fairly obvious:

backup
    When "backup" is present on a server line, the server is only used in load
    balancing when all other non-backup servers are unavailable. Requests coming
    with a persistence cookie referencing the server will always be served
    though. By default, only the first operational backup server is used, unless
    the "allbackups" option is set in the backend. See also the "allbackups"
    option.

In any event, you could do it like this:

backend JavaApp
  mode http
  # Active Servers
  default-server weight 100 port 80
  server AppServer1 10.0.0.1:80 check
  # Backup Servers
  server AppServer2 10.0.0.2:80 check backup
GregL
  • 9,370
  • 2
  • 25
  • 36