OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 17.7 Legacy Series »
  • [SOLVED] Re: haproxy and healthcheck where is IF condition ?
« previous next »
  • Print
Pages: [1]

Author Topic: [SOLVED] Re: haproxy and healthcheck where is IF condition ?  (Read 5051 times)

netbja

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
    • View Profile
[SOLVED] Re: haproxy and healthcheck where is IF condition ?
« on: January 17, 2018, 11:04:24 pm »
Hi all,

Just to clarify or understand this haproxy (2.2) implementation.
I have just created an OPNsense cluster for my customer with haproxy plugin for load balancing Exchange 2016 servers.

Here is an partial output from /usr/local/etc/haproxy.conf file.

Code: [Select]
# Backend: bk_exchange_owa (Exchange Backend OWA)
backend bk_exchange_owa
    # health check: hc_owa
    option httpchk GET /owa/HealthCheck.htm
    http-check expect status 200\ OK

As you can see, I have #health check: hc_owa commented but no trace in the haproxy.conf with acl or use_backend :

We should have this lines in haproxy.conf.
Code: [Select]
acl path_owa path_beg -i /owa/and
Code: [Select]
use_backend bk_exchange_owa if path_owa
Is it a bug ?

Thank you for your help.
 
« Last Edit: January 25, 2018, 12:00:46 am by netbja »
Logged

fraenki

  • Full Member
  • ***
  • Posts: 171
  • Karma: 28
    • View Profile
    • GitHub
Re: haproxy and healthcheck where is IF condition ?
« Reply #1 on: January 18, 2018, 06:25:43 pm »
Quote from: netbja on January 17, 2018, 11:04:24 pm
As you can see, I have #health check: hc_owa commented but no trace in the haproxy.conf with acl or use_backend :

You're confusing health checks with ACLs. A health check does not involve an if-clause.

Quote from: netbja on January 17, 2018, 11:04:24 pm
We should have this lines in haproxy.conf.
Code: [Select]
acl path_owa path_beg -i /owa/and
Code: [Select]
use_backend bk_exchange_owa if path_owa

You need to create a ACL for this. In our HAProxy plugin version 2.0 (and later) there is a two-step approach to creating a ACL:

# Go to "Rules & Checks" and create a "Condition"
# Go to "Rules & Checks" and create a "Rule" that utilizes the previously created "Condition"

Next you'll need to add this "Rule" to either your frontend ("Public Service") or backend ("Backend Pool").


Regards
- Frank
Logged

netbja

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
    • View Profile
Re: haproxy and healthcheck where is IF condition ?
« Reply #2 on: January 19, 2018, 02:21:49 pm »
Hello Franck,

You are right but did you try what you are saying ?

Sure I made Conditions and Rules  in "Rules & Checks" but the configuration file haproxy.conf does not contain any Conditions and any Rules.

So is it a bug ?

Thank you.

BJA.
« Last Edit: January 19, 2018, 02:48:00 pm by netbja »
Logged

fraenki

  • Full Member
  • ***
  • Posts: 171
  • Karma: 28
    • View Profile
    • GitHub
Re: haproxy and healthcheck where is IF condition ?
« Reply #3 on: January 19, 2018, 02:53:01 pm »
Quote from: netbja on January 19, 2018, 02:21:49 pm
You are right but did you try what you are saying ?

Yes, I'm using multiple versions of the HAProxy plugin in production.

Quote from: netbja on January 19, 2018, 02:21:49 pm
Sure I made Conditions and Rules  in "Rules & Checks" but the configuration file haproxy.conf does not contain any Conditions and any Rules.

So is it a bug ?

Please provide screenshots of your configuration, or even better, a backup of your config.xml (only the HAProxy tag).


Regards
- Frank
Logged

netbja

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
    • View Profile
Re: haproxy and healthcheck where is IF condition ?
« Reply #4 on: January 19, 2018, 07:13:13 pm »
Hello again Frank,

In attach file, the config file config.xml

Thank you.

BJA.



« Last Edit: January 20, 2018, 12:20:59 am by netbja »
Logged

netbja

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
    • View Profile
[SOLVED] Re: haproxy and healthcheck where is IF condition ?
« Reply #5 on: January 24, 2018, 11:48:49 pm »
Finaly I understand where I can put my ACL in FrontEnd, but it's a little bit more tricky than a txt file with native haproxy.

Cheers.

« Last Edit: January 25, 2018, 12:01:21 am by netbja »
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 17.7 Legacy Series »
  • [SOLVED] Re: haproxy and healthcheck where is IF condition ?
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2