Tomcat Load Balancing Confusion

Posted by christian.bryan@capita.co.uk on 01-Apr-2019 10:34

Hi All 

I am confused, not for the first time!

The Openedge documentation talks about setting up Tomcat Load Balancing for the PAS - https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/pasoe-admin%2Ftomcat-load-balancing.html%23

And mentions creating a PAS lb and status instance.

However i am not sure what the point of those instances are as TC load balancing can use virtual equivalents of those as referenced in the attached document which is referenced in the KB article - https://knowledgebase.progress.com/articles/Article/how-to-configure-pasoe-for-load-balancing

[View:/cfs-file/__key/communityserver-discussions-components-files/22/PAS4OELoadBalancing_2D00_Eng_2D00_v2.pdf:320:240]

The Openedge documentation does not explain how these PASOE lb and status instances are referenced and why you would create these instances rather than use the virtual ones in MOD_JK.

I have also seen sight of articles that describe how you don't need sticky sessions for load balancing if you use the PASOE tomcat load balancing route but again it seems to be very poorly explained.

Is there a more definitive explanation of the pro's and con's and how to guides for above options.

Christian.

Posted by christian.bryan@capita.co.uk on 07-May-2019 16:46

I have got this working now.

My issue was that i misunderstood the Tomcat clustering and the Load Balancing which are independent of each other,

My setup now has:

1. Apache HTTPD web server with Mod_JK installed and a virtual 'lb' and 'status' instances with a worker.properties file containing PAS instances with their respective AJP ports.

2. I have clustered my PAS instances and they are replicating sessions between each other for this you need to turn on AJP and Clustering on each PAS instances and make sure they share the same multicast address and port, all settings are in the catalina.properties file.

Once you have clustering working and you can test this without a load balancer, you can then test with the load balancer.

I then set the following in the worker.properties:

#

# Load balancer directives

# CJB remember to turn off sticky sessions and let the clustering support session replication

#

worker.lb.type=lb

worker.lb.balance_workers=OneFormBlue,OneForm

worker.lb.sticky_session=true

worker.lb.sticky_session_force=false

worker.lb.method=Request

The key here is that i am using sticky sessions but i am not forcing them, which means if one of PAS instances goes down the Load Balancer will recognize this and move the request on to another PAS instance.

I am doing this with the JSDO and FORM based pas instances, but its easy enough to test in POSTMAN.

Posted by christian.bryan@capita.co.uk on 07-May-2019 16:47

I have got this working now.

My issue was that i misunderstood the Tomcat clustering and the Load Balancing which are independent of each other,

My setup now has:

1. Apache HTTPD web server with Mod_JK installed and a virtual 'lb' and 'status' instances with a worker.properties file containing PAS instances with their respective AJP ports.

2. I have clustered my PAS instances and they are replicating sessions between each other for this you need to turn on AJP and Clustering on each PAS instances and make sure they share the same multicast address and port, all settings are in the catalina.properties file.

Once you have clustering working and you can test this without a load balancer, you can then test with the load balancer.

I then set the following in the worker.properties:

#

# Load balancer directives

# CJB remember to turn off sticky sessions and let the clustering support session replication

#

worker.lb.type=lb

worker.lb.balance_workers=OneFormBlue,OneForm

worker.lb.sticky_session=true

worker.lb.sticky_session_force=false

worker.lb.method=Request

The key here is that i am using sticky sessions but i am not forcing them, which means if one of PAS instances goes down the Load Balancer will recognize this and move the request on to another PAS instance.

I am doing this with the JSDO and FORM based pas instances, but its easy enough to test in POSTMAN.

Posted by christian.bryan@capita.co.uk on 07-May-2019 16:48

I have got this working now.

My issue was that i misunderstood the Tomcat clustering and the Load Balancing which are independent of each other,

My setup now has:

1. Apache HTTPD web server with Mod_JK installed and a virtual 'lb' and 'status' instances with a worker.properties file containing PAS instances with their respective AJP ports.

2. I have clustered my PAS instances and they are replicating sessions between each other for this you need to turn on AJP and Clustering on each PAS instances and make sure they share the same multicast address and port, all settings are in the catalina.properties file.

Once you have clustering working and you can test this without a load balancer, you can then test with the load balancer.

I then set the following in the worker.properties:

#

# Load balancer directives

# CJB remember to turn off sticky sessions and let the clustering support session replication

#

worker.lb.type=lb

worker.lb.balance_workers=OneFormBlue,OneForm

worker.lb.sticky_session=true

worker.lb.sticky_session_force=false

worker.lb.method=Request

The key here is that i am using sticky sessions but i am not forcing them, which means if one of PAS instances goes down the Load Balancer will recognize this and move the request on to another PAS instance.

I am doing this with the JSDO and FORM based pas instances, but its easy enough to test in POSTMAN.

All Replies

Posted by bronco on 01-Apr-2019 12:06

Well, in the end PAS is "just" Tomcat, so I think this is what you're looking for: tomcat.apache.org/.../loadbalancers.html

Posted by christian.bryan@capita.co.uk on 01-Apr-2019 12:11

HI Bronco

The link documents creating a virtual load balance and i have done this and it works so all good.

What is confusing is that the OE documentation tells you to actually create a pas instance using tcman with the name lb.

So i am a little confused!

Posted by Ram Krushna Mishra on 06-Apr-2019 07:16

Hi Bronco,

"lb/jklb" and "status/jkstatus" are special pas instances which can be created to use for tomcat load balancing.

If you create the instance with these names and use "pasman workers" to create the workers.properties file , then pasman or tcman understand these special instance and they are being used as loadbalancer and status monitor respectively.

i.e we will automatically detect them and place them in loadbalancer and status worker directive respectively in the worker.propeties file.

This is for user convenience so that they do not need to manually edit or create worker files. This will be automatic if the instance names are lb and status.

All other names are considered as workers and users will have to manually edit the worker.properties file or create it to place the load balance directive and status worker directive by themselves.

I hope this explains the need for 'lb' and 'status' instance. Please let us know if any other information is required.

Thanks and Regards,

Ram Krushna

Posted by christian.bryan@capita.co.uk on 07-May-2019 16:46

I have got this working now.

My issue was that i misunderstood the Tomcat clustering and the Load Balancing which are independent of each other,

My setup now has:

1. Apache HTTPD web server with Mod_JK installed and a virtual 'lb' and 'status' instances with a worker.properties file containing PAS instances with their respective AJP ports.

2. I have clustered my PAS instances and they are replicating sessions between each other for this you need to turn on AJP and Clustering on each PAS instances and make sure they share the same multicast address and port, all settings are in the catalina.properties file.

Once you have clustering working and you can test this without a load balancer, you can then test with the load balancer.

I then set the following in the worker.properties:

#

# Load balancer directives

# CJB remember to turn off sticky sessions and let the clustering support session replication

#

worker.lb.type=lb

worker.lb.balance_workers=OneFormBlue,OneForm

worker.lb.sticky_session=true

worker.lb.sticky_session_force=false

worker.lb.method=Request

The key here is that i am using sticky sessions but i am not forcing them, which means if one of PAS instances goes down the Load Balancer will recognize this and move the request on to another PAS instance.

I am doing this with the JSDO and FORM based pas instances, but its easy enough to test in POSTMAN.

Posted by christian.bryan@capita.co.uk on 07-May-2019 16:47

I have got this working now.

My issue was that i misunderstood the Tomcat clustering and the Load Balancing which are independent of each other,

My setup now has:

1. Apache HTTPD web server with Mod_JK installed and a virtual 'lb' and 'status' instances with a worker.properties file containing PAS instances with their respective AJP ports.

2. I have clustered my PAS instances and they are replicating sessions between each other for this you need to turn on AJP and Clustering on each PAS instances and make sure they share the same multicast address and port, all settings are in the catalina.properties file.

Once you have clustering working and you can test this without a load balancer, you can then test with the load balancer.

I then set the following in the worker.properties:

#

# Load balancer directives

# CJB remember to turn off sticky sessions and let the clustering support session replication

#

worker.lb.type=lb

worker.lb.balance_workers=OneFormBlue,OneForm

worker.lb.sticky_session=true

worker.lb.sticky_session_force=false

worker.lb.method=Request

The key here is that i am using sticky sessions but i am not forcing them, which means if one of PAS instances goes down the Load Balancer will recognize this and move the request on to another PAS instance.

I am doing this with the JSDO and FORM based pas instances, but its easy enough to test in POSTMAN.

Posted by christian.bryan@capita.co.uk on 07-May-2019 16:48

I have got this working now.

My issue was that i misunderstood the Tomcat clustering and the Load Balancing which are independent of each other,

My setup now has:

1. Apache HTTPD web server with Mod_JK installed and a virtual 'lb' and 'status' instances with a worker.properties file containing PAS instances with their respective AJP ports.

2. I have clustered my PAS instances and they are replicating sessions between each other for this you need to turn on AJP and Clustering on each PAS instances and make sure they share the same multicast address and port, all settings are in the catalina.properties file.

Once you have clustering working and you can test this without a load balancer, you can then test with the load balancer.

I then set the following in the worker.properties:

#

# Load balancer directives

# CJB remember to turn off sticky sessions and let the clustering support session replication

#

worker.lb.type=lb

worker.lb.balance_workers=OneFormBlue,OneForm

worker.lb.sticky_session=true

worker.lb.sticky_session_force=false

worker.lb.method=Request

The key here is that i am using sticky sessions but i am not forcing them, which means if one of PAS instances goes down the Load Balancer will recognize this and move the request on to another PAS instance.

I am doing this with the JSDO and FORM based pas instances, but its easy enough to test in POSTMAN.

Posted by christian.bryan@capita.co.uk on 07-May-2019 16:48

I have got this working now.

My issue was that i misunderstood the Tomcat clustering and the Load Balancing which are independent of each other,

My setup now has:

1. Apache HTTPD web server with Mod_JK installed and a virtual 'lb' and 'status' instances with a worker.properties file containing PAS instances with their respective AJP ports.

2. I have clustered my PAS instances and they are replicating sessions between each other for this you need to turn on AJP and Clustering on each PAS instances and make sure they share the same multicast address and port, all settings are in the catalina.properties file.

Once you have clustering working and you can test this without a load balancer, you can then test with the load balancer.

I then set the following in the worker.properties:

#

# Load balancer directives

# CJB remember to turn off sticky sessions and let the clustering support session replication

#

worker.lb.type=lb

worker.lb.balance_workers=OneFormBlue,OneForm

worker.lb.sticky_session=true

worker.lb.sticky_session_force=false

worker.lb.method=Request

The key here is that i am using sticky sessions but i am not forcing them, which means if one of PAS instances goes down the Load Balancer will recognize this and move the request on to another PAS instance.

I am doing this with the JSDO and FORM based pas instances, but its easy enough to test in POSTMAN.

Posted by christian.bryan@capita.co.uk on 07-May-2019 16:49

I have got this working now.

My issue was that i misunderstood the Tomcat clustering and the Load Balancing which are independent of each other,

My setup now has:

1. Apache HTTPD web server with Mod_JK installed and a virtual 'lb' and 'status' instances with a worker.properties file containing PAS instances with their respective AJP ports.

2. I have clustered my PAS instances and they are replicating sessions between each other for this you need to turn on AJP and Clustering on each PAS instances and make sure they share the same multicast address and port, all settings are in the catalina.properties file.

Once you have clustering working and you can test this without a load balancer, you can then test with the load balancer.

I then set the following in the worker.properties:

#

# Load balancer directives

# CJB remember to turn off sticky sessions and let the clustering support session replication

#

worker.lb.type=lb

worker.lb.balance_workers=OneFormBlue,OneForm

worker.lb.sticky_session=true

worker.lb.sticky_session_force=false

worker.lb.method=Request

The key here is that i am using sticky sessions but i am not forcing them, which means if one of PAS instances goes down the Load Balancer will recognize this and move the request on to another PAS instance.

I am doing this with the JSDO and FORM based pas instances, but its easy enough to test in POSTMAN.

This thread is closed