I'm looking for a good load balancer to use with Tomcat. Our application doesn't store anything in the session context so it isn't important to redirect to same server for the same user. I'd simply like something that can queue requests round-robin style or based on each server's inidividual load. I'd also like to be able to add application servers to those available to handle requests without having to restart the load balancer. We're running the application on linux if that matters.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
If all you need is a software load balancer on linux use Apache Webserver2, Mod-Jk and Tomcat Clustering:
At your Webserver:
1) Install apache2 and modjk:
2) Create a "workers.properties" file available to your apache2. In some cases ist automatically created in your /etc/apache2 directory. This file is holding the lb config, node names, ips and ports of your Tomcat servers, i.e.:
3) Create a Mod-Jk section in your apache2 config file, if it has not been created automatically.
4) Mount your application to the load balancer (apache2 config file):
At your Tomcat servers:
5) Install tomcat using the tarball package (way better then the apt verison). Change server.xml:
add jvmRoute with the right node name to the "Engine" element:
add a "Cluster" element for simplest configuration
6) Deploy your application to all tomcats and add a distributable element to your web.xml.
7) Make sure the webserver can access the ajp ports on your tomcat servers and no one else can.
8) Start the webserver and the tomcats one after another and check the logs (/var/log/apache2/mod_jk.log, too).
9) Access your app: http://mywebserver.com/MyApp
10) Check (and deny access to) the lb status page http://mywebserver.com/modjkstatus