Help with Load balancing with HAProxy and 3 Frappe/ERPNext Nodes

Hello, I’ve been trying to use HAProxy as a reverse proxy and load balancer to 3 frappe/erpnext virtual machines. Currently, the haproxy IP works, but I get stuck on the log in because of an authentication problem.

I get this error once I enter the login credentials correctly:

here is my haproxy config file:

    log /dev/log local0 notice
    maxconn 2000
    user haproxy
    group haproxy

    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    option redispatch
    timeout connect  5000
    timeout client  50000
    timeout server  50000

frontend tailerp
    bind *:80
    mode http
    default_backend servers

backend servers
    balance leastconn
    option forwardfor
    option httpchk HEAD / HTTP/1.1\r\nHost:localhost
    http-request del-header Authorization
    server frappe check
    server frappe1 check
    server frappe2 check

Any help would be appreciated. Thanks!

Can you delete lines from backend that begin with option httpchk… and http-request del-header? See if it changes error. I am using haproxy for one of our installation and does not have those lines. Rest configuration seems fine. Seems no https - fyi.

I have seen this error when someone tries to access a document using QR code (url) in say sales invoice (pdf) but does not have login credentials.

Interested to know how you sync database across nodes… Will appreciate if you could share any info on that.

I tried doing that at first, still had the same error. I found a thread here in discuss where they added the lines but yeah, it’s still not working.

Will be using either Mariadb Galera clustering or Percona to sync the db’s. Or might have to use a remote mariadb host. If HAProxy and the clustering doesn’t work, might have to result to upgrading our server to higher specs instead of setting up a cluster.

Managed to get it working by enabling session stickiness. :slight_smile: Now all I have to do is figure out out how cluster the databases without breaking the installation. Thanks!

1 Like