...
The prerequisites are the hard part.
Tomcat Configuration
Server.xml Connector Addition
Tomcats will need to have a new connector configured in server.xml. The new
connector stanza should look something like the following:
...
Thread counts and connection timeout should be adjusted to your needs.
Server.xml jvmRoute Addition
To enable sticky sessions, the jvmRoute attribute needs to be set on the Engine stanza.
Code Block | ||
---|---|---|
| ||
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"> |
The value for jvmRoute needs to match the identifier for the Tomcat server defined in workers.properties in Apache. (See below.)
Apache Configuration
Install Mod_JK
...
Code Block |
---|
worker.list=loadbalancer,jkstatus # Properties for worker1 worker.tomcat1.port=8009 worker.tomcat1.host=<Tomcat 1 server name or IP> worker.tomcat1.type=ajp13 worker.tomcat1.lbfactor=10 worker.tomcat1.connec.onconnection_pool_size=1 # Properties for worker2 worker.tomcat2.port=8009 worker.tomcat1.host=<Tomcat 2 server name or IP> worker.tomcat2.type=ajp13 worker.tomcat2.lbfactor=20 worker.tomcat2.connec.onconnection_pool_size=1 # Properties for loadbalancer worker.loadbalancer.type=lb #worker.lodbalancer.balanced_workers=tomcat2,tomcat1 worker.loadbalancer.s.ckysticky_session=1 # Properties for jkstatus worker.jkstatus.type=status |
...
Restart Apache and test that the configuration is working. Open a browser and visit the JK Manager. If you have issues review the changes to httpd.conf files and the worker.properties file. Once you can reach the JK Manager, test that traffic is redirecting to the portal by pointing a browser at http://<apache_server>/uPortal/ .
Info | ||||
---|---|---|---|---|
| ||||
https://tomcat.apache.org/connectors-doc/common_howto/loadbalancers.html |
Warning | ||||
---|---|---|---|---|
| ||||
Please send us feedback at uportal-user@lists.ja-sig.org |