The Blog

Liferay clustering checklist

published April 21, 2011

Yesterday our team finished clustering of our Liferay portal environment. In case I have to do this again, I decided to write a small checklist what should be taken into a consideration when clustering. Official Liferay clustering guide can be found here.

Updated May 6, 2011: added ajp configurations.

Updated May 20, 2011: Check also how Apache AJP protocol works.

1. Ensure that you have same JRE/JDK on both cluster nodes.

2. Check that all Liferay nodes can access your database (or database cluster) and it allows connections from these hosts.

3. Ensure that load balancer can forward requests to both nodes and firewalls won’t block access.

4. Check that all of  cluster nodes are able to send email using your configured SMTP server (e.g. with telnet).

5. Install same version of Liferay to all cluster nodes.

6. If you need session fail over, configure that.

7. Configure tomcat connectors “secure” and “unsecure” to use ajp protocol like so:

<Connector address="xx.xx.xx.xx" port="8009" protocol="AJP/1.3" ... />
<Connector address="xx.xx.xx.xx" port="8443" protocol="AJP/1.3" ... />

8. Configure properties “net.sf.ehcache.configurationResourceName” and “ehcache.multi.vm.config.location” correctly to portal-ext.properties.

9. Move your Lucene index to database or if that is not possible, to shared NFS mount. In case of shared NFS mount, linux UIDs for Liferay user must be equal in all nodes so that Linux file permissions work correctly.  Liferay user must be able to write to Lucene directory.

10. Move your document library to shared NFS mount or to database. Same rules apply as above.

11. Ensure that your configured Lucene index and document library paths point to correct location in portal-ext.properties.

12. Start your cluster nodes.

13. Check that mod_proxy_ajp module is loaded by apache.

14. Configure Apache  load balancer like so:
Proxy balancers:

<Proxy balancer://liferaycluster>
BalancerMember ajp://node1:8009 route=node1 ping=5 loadfactor=1
BalancerMember ajp://node2:8009 route=node2 ping=5 loadfactor=1
ProxySet stickysession=ROUTEID
</Proxy>


<Proxy balancer://secureliferaycluster>
BalancerMember ajp://node1:8443 route=node1 ping=5 loadfactor=1
BalancerMember ajp://node2:8443 route=node2 ping=5 loadfactor=1
ProxySet stickysession=ROUTEID
</Proxy>

This inside your :80 virtual host:

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
ProxyPass /group balancer://secureliferaycluster/group/
ProxyPassReverse /group balancer://secureliferaycluster/group/
ProxyPass / balancer://liferaycluster/
ProxyPassReverse / balancer://liferaycluster/

This inside your :443 virtual host:

ProxyPass /group balancer://secureliferaycluster/group/
ProxyPassReverse /group balancer://secureliferaycluster/group/
ProxyPass / balancer://liferaycluster/
ProxyPassReverse / balancer://liferaycluster/

That’s it!

Samuli @ 20:31 (2 Comments)

tags:

Trackback URL

2 Comments to Liferay clustering checklist
Eric G says on February 23, 2012 @ 19:33:24:

For most clustered environments, I would strongly recommend against using Lucene in DB (writes are horrifically slow). If NFS is not an option, then using a seperate SOLR node and the SOLR plugin is the best way to go. It’s a pretty straightforward setup to do, simply

1/ Download and install SOLR onto a server (up to you if you want to configure a sharded or failover configuration, pretty straight forward to do in either case)

2/ From the liferay.com site, download the solr-web plugin. A quick wiki search on liferay.com explains how to configure the war file.

3/ Upload to the liferay portal, et voila.

Samuli says on February 29, 2012 @ 15:21:04:

Thanks for the tip!

top











b

Subscribe to RSS feed

The Tag Cloud
The Blog Archive

January 2013 (1)

February 2012 (1)

January 2012 (1)

November 2011 (1)

June 2011 (2)

May 2011 (1)

April 2011 (2)

March 2011 (2)

February 2011 (1)

January 2011 (1)

December 2010 (1)

November 2010 (1)

October 2010 (3)

September 2010 (3)

August 2010 (5)

July 2010 (2)

June 2010 (3)

May 2010 (4)

April 2010 (2)

March 2010 (6)

February 2010 (7)

January 2010 (3)

December 2009 (7)

November 2009 (6)