Hi Community,

 

To test the HAProxy, I've installed two Creatio Applications on my virtual machine, using Docker. Each instance can be access through a specific container address.

 

I've successfully configured HAProxy by following this guide (https://academy.creatio.com/docs/user/on_site_deployment/deployment_additional_setup/application_server_web_farm_shortcut/application_server_web_farm). If I stop one of the containers, the HAProxy sends the requests to the other container, as expected. However, when both containers are up and running, I cannot pass through the login page.

 

I need help to understand:

What is the cause of such behaviour?

What are the possible solutions to solve this problem?

Will this problem occur if each instance is in a separated machine?

 

Note: I’ve notice on other tests that when I have two Creatio instances on the same machine I can only be logged one at the time. Maybe this is related to the problem.

 

Best Regards,

Pedro Pinheiro

Like 1

Like

3 comments

I think I’ve managed to solve this problem. In some applications we need to ensure that the user must be connected to the same server during the whole session. So, to allow this I changed the Load Balance Algorithm to source.

frontend front
     maxconn 10000
     #Using these ports for binding
     bind *:80
     bind *:443
     #Convert cookies to be secure
     rspirep ^(set-cookie:.*)  \1;\ Secure
     default_backend creatio
 
backend creatio
     #set balance type
     balance source       
     server node_1 nodeserver1:80 check weight 2
     server node_2 nodeserver2:80 check weight 1

The problem was solved, but I don't know if this is the correct way to solve it. I would like to hear some feedback. Thank you.

 

Best Regards,

Pedro Pinheiro

Hi Pedro, 



We generally recommend using round-robin, as it's optimal in most cases, but the "source" algorithm is working as well. 

As for why the log-in issue happened: it's hard to say definitely, but on of the options is if the machinekey is different on different nodes - it won't let you log in. 

 

Best regards,

Yurii.

Hi Yurii Sokil,

 

I moved this infrastructure to a Linux server. In this server I have the same two instances but with different ports instead of docker containers. How can I generate this "machinekey”?

 

The documentation only explains how to generate them on windows servers, through  PowerShell.

 

Best Regards,

Pedro Pinheiro

Show all comments