OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: Patrick M. Hausen on January 28, 2022, 05:05:19 PM

Title: HA Proxy - static active/passive failover?
Post by: Patrick M. Hausen on January 28, 2022, 05:05:19 PM
Hi all,

I migrated a TYPO3 cluster from Kemp Loadmaster to OPNsense. The policy mandated by the customer and the application is:

- all requests go to the master server
- only if the master server fails, the requests go to the backup server
- in the rare event that both servers fail, a static "sorry" page from a third system is to be displayed

Currently I have the master set to "active" and the backup set to "backup". This satisfies the first two conditions. Unfortunately reading up in the documentation reveals that "backup" is actually intended to be used for "sorry" pages.

So how can I achieve a static distribution with one node the only active one until it fails? Would setting the weight of the backup node to 0 do the trick? Picking 255 for the master and 1 for the backup will schedule one request out of 256 to the backup, which is not what we need.

Thanks!
Patrick
Title: Re: HA Proxy - static active/passive failover?
Post by: fraenki on January 29, 2022, 10:33:17 AM
I would probably add multiple backends, one for the "website" and one for the "sorry" site. A rule should be added to the frontend to check the number of usable servers in the "website" backend, and switch to the "sorry" backend when no usable server is available.
Title: Re: HA Proxy - static active/passive failover?
Post by: Patrick M. Hausen on January 29, 2022, 01:15:32 PM
That's clever. Thanks.