Using HAProxy as a load balancer.
From the official guide set the configuration:
https://confluence.atlassian.com/enterprise/jira-data-center-load-balancer-examples-781200827.html
Here is the configuration for HAProxy:
frontend jira
bind :::8080 v4v6
default_backend jirafrontend confluence
bind :::8090 v4v6
default_backend confluencebackend jira
balance roundrobin
cookie JSESSIONID prefix nocache
server jira1 [IP1]:8080 check cookie jira1
server jira2 [IP2]:8080 check cookie jira2backend confluence
balance roundrobin
cookie JSESSIONID prefix nocache
server confluence1 [IP3]:8090 check cookie confluence1
server confluence2 [IP4]:8090 check cookie confluence2
It works when login into the system. But after refresh page sometime, it will been logout automatically.
And, I didn't find cookie in browser after login into the system as screenshot attached.