Hi

I have a 3 node cluster running behind a HAProxy setup.
My haproxy.cfg looks like this:
global
    log stdout format iso local1 debug # rfc3164, rfc5424, short, raw, (iso)
    log stderr format iso local0 err # rfc3164, rfc5424, short, raw, (iso)
    hard-stop-after 30s

defaults
    log global
    mode http
    option httplog
    option dontlognull
    timeout connect 5s
    timeout client 50s
    timeout server 15s

frontend nifi-ui
    bind *:8443
    bind *:443
    mode tcp
    option tcplog
    default_backend nifi-ui-nodes

backend nifi-ui-nodes
    mode tcp
    balance roundrobin
    stick-table type ip size 200k expire 30m
    stick on src
    option httpchk
    http-check send meth GET uri / ver HTTP/1.1 hdr Host
nifi-cluster01.foo.bar
    server C01N01 nifi-c01n01.foo.bar:8443 check check-ssl verify none
inter 5s downinter 5s fall 2 rise 3
    server C01N02 nifi-c01n02.foo.bar:8443 check check-ssl verify none
inter 5s downinter 5s fall 2 rise 3
    server C01N03 nifi-c01n03.foo.bar:8443 check check-ssl verify none
inter 5s downinter 5s fall 2 rise 3

I have 2 proxy nodes, which is running in a HA setup with keepalived and
with a vip.
I have a dns record nifi-cluster01.foo.bar pointing to the vip address to
keepalived.

In your nifi-properties files you would have so set a proxy host address:
nifi.web.proxy.host: "nifi-cluster01.foo.bar:8443"

This setup is working for me.

Kind regards
Jens M. Kofoed



Den ons. 6. sep. 2023 kl. 16.17 skrev Minh HUYNH <e-soci...@gmx.fr>:

> Hello Juan
>
> Not sure if you understand my point of view ?
>
> It got a cluster nifi01/nifi02/nifi03
>
> I try to use unique url for instance https://nifi_clu01:9091/nifi, this
> link point to the randomly nifi01/nifi02/nifi03
>
> Regards
>
>
> *Envoyé:* mercredi 6 septembre 2023 à 16:05
> *De:* "Juan Pablo Gardella" <gardellajuanpa...@gmail.com>
> *À:* users@nifi.apache.org
> *Objet:* Re: Help : LoadBalancer
> List all servers you need.
>
> server server1 "${NIFI_INTERNAL_HOST1}":8443 ssl
> server server2 "${NIFI_INTERNAL_HOST2}":8443 ssl
>
> On Wed, Sep 6, 2023 at 10:35 AM Minh HUYNH <e-soci...@gmx.fr> wrote:
>
>> Thanks a lot for reply.
>>
>> Concerning redirection for one node. It is ok we got it.
>>
>> But how configure nifi and haproxy to point the cluster node, for
>> instance cluster nodes "nifi01, nifi02, nifi03"
>>
>> regards
>>
>> Minh
>>
>>
>>
>> *Envoyé:* mercredi 6 septembre 2023 à 15:29
>> *De:* "Juan Pablo Gardella" <gardellajuanpa...@gmail.com>
>> *À:* users@nifi.apache.org
>> *Objet:* Re: Help : LoadBalancer
>> I did that multiple times. Below is how I configured it:
>>
>> frontend http-in
>> # bind ports section
>> acl prefixed-with-nifi path_beg /nifi
>> use_backend nifi if prefixed-with-nifi
>> option forwardfor
>>
>> backend nifi
>> server server1 "${NIFI_INTERNAL_HOST}":8443 ssl
>>
>>
>>
>> On Wed, Sep 6, 2023 at 9:40 AM Minh HUYNH <e-soci...@gmx.fr> wrote:
>>
>>>
>>> Hello,
>>>
>>> I have been trying long time ago to configure nifi cluster behind the
>>> haproxy/loadbalancer
>>> But until now, it is always failed.
>>> I have only got access to the welcome page of nifi after all others
>>> links are failed.
>>>
>>> If someone has the configuration, it is helpfull.
>>>
>>> Thanks a lot
>>>
>>> Regards
>>>
>>
>>
>>
>
>
>

Reply via email to