The Blog
One click deployment to clustered Liferay with Jenkins
published April 27, 2011
During last year, we have built pretty cool one click deployment system with Jenkins. Environment has been created little by little, but when decision was made to cluster Liferay and in addition to serve our 15.000 lines of JavaScript code from Apache, it was pretty clear that manual installations would be a pain. So we built environment like this:
Developer can initiate (1) portlet build from the Jenkins CI GUI. Jenkins runs (2) Ant build, unit tests, selenium tests and builds multiple war packages. If build is successful Jenkins first copies (3) our JavaScript framework to Apache and then deploys (4) portlet wars to clustered liferay environment. All this with one click.
Configuration is pretty simple, each copy step is run as a shell script like so:
./deployFrameworkToApache.sh;
./deployPortletsToNode1.sh;
./deployPortletsToNode2.sh;
I have to give credit to Jenkins, it is really easy to configure.
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!
Subscribe to RSS feed
The Tag Cloud
Agile Business Coaching Coding horror Conference Customer Design of Experiments Future Group dynamics ITIL It should not be that hard Java EE Kanban Leadership Lean Liferay Methodologies Natural UI Performance tuning Process Productivity Quality Retrospective RIA Scrum Six Sigma Social psychology Software Software architecture Testing This is great TOGAF
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
Samuli's Links
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)

