NiFi UI load balance with HAProxy to CONNECTED nodes only
Hello, guys!
I still have a three-node cluster Apache NiFi 1.18.0 (yeap, upgrade task in by backlog =)) and trying to setup it behind HAProxy just for UI (/nifi endpoint).
I wanna to implement a health check to balance user requests only to nodes in CONNECTED status to avoid issues when nodes moves to maintenance (offload, disconnect).
Is it good idea, right? Or maybe I do some overengineering things? 😃
By the way, I have next HAProxy config file:
frontend nifi_443
bind *:443 ssl crt /etc/haproxy/ssl/cert_file.pem
http-request set-path /nifi if { path / }
mode http
option httplog
acl DST_IP dst 10.0.0.10
use_backend nifi_ui_9443 if DST_IP
backend nifi_ui_9443
mode http
option httpchk
http-check send meth GET uri /nifi-api/access/config ver HTTP/1.1 hdr Host nifi-cluster.corp.company.com
http-check expect status 200
cookie SERVERID insert indirect nocache
balance leastconn
server srv_1 10.0.0.1:9443 check ssl verify none cookie web1
server srv_2 10.0.0.2:9443 check ssl verify none cookie web2
server srv_3 10.0.0.3:9443 check ssl verify none cookie web3Basically it works fine when all nodes are CONNECTED, but if some node goes to DISCONNECTED state, http-check to selected API method still returns 200 and HAProxy continues to route users to that node.
So, give an advice, please. How can I configure HAProxy health-check to get expected behavior? Thanks a lot.

