...
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 | ||
---|---|---|
| ||
<IfModule mod_jk.c> JkWorkersFile "<path_to_apache_config>/workers.properties" JkLogFile "|<path_to_apache_bin>/rotatelogs <path_to_apache_logs>/mod_jk.log 86400" JkLogLevel error JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" JkRequestLogFormat "%w %V %T %U %q" JkMount /uPortal* loadbalancer JkMount /uPortal/* loadbalancer ... </IfModule> |
Warning | ||
---|---|---|
| ||
If your installation uses virtual hosts, you may need to add JkMountCopy On into the Virtual Host entry. |
Additional JkMount entries can be included for load balancing requests to portlet APIs such as `/ResourceServingWebapp/*` to loadbalancer.
...
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 |