Prerequisites
- liferay-portal-tomcat-6.1.20-ee-ga2-20120731110418084.zip
- ehcache-cluster-web-6.1.20.1-ee-ga2-20120731110418084.war
- liferay-portal-src-6.1.20-ee-ga2-20120731110418084.zip
- 2 Linux nodes with JDK installed
- Liferay Cluster License
- Firewall should be off in both nodes
Follow below steps for Liferay 6.1 EE GA2 Cluster Configuration
1. Extract liferay-portal-tomcat-6.1.20-ee-ga2-20120731110418084.zip in /opt/ in both nodes. Rename extracted directory name to liferay. (ex: /opt/liferay)
2. Create portal-ext.properties file in /opt/liferay in both nodes and add below cluster related properties. Both Liferay nodes should be pointing to single Database.
net.sf.ehcache.configurationResourceName=/myehcache/hibernate-clustered.xml
ehcache.multi.vm.config.location=/myehcache/liferay-multi-vm-clustered.xml
cluster.link.enabled=true
lucene.replicate.write=true
ehcache.cluster.link.replication.enabled=true
web.server.display.node=true
org.quartz.jobStore.isClustered=true
- liferay-portal-tomcat-6.1.20-ee-ga2-20120731110418084.zip
- ehcache-cluster-web-6.1.20.1-ee-ga2-20120731110418084.war
- liferay-portal-src-6.1.20-ee-ga2-20120731110418084.zip
- 2 Linux nodes with JDK installed
- Liferay Cluster License
- Firewall should be off in both nodes
Follow below steps for Liferay 6.1 EE GA2 Cluster Configuration
1. Extract liferay-portal-tomcat-6.1.20-ee-ga2-20120731110418084.zip in /opt/ in both nodes. Rename extracted directory name to liferay. (ex: /opt/liferay)
2. Create portal-ext.properties file in /opt/liferay in both nodes and add below cluster related properties. Both Liferay nodes should be pointing to single Database.
net.sf.ehcache.configurationResourceName=/myehcache/hibernate-clustered.xml
ehcache.multi.vm.config.location=/myehcache/liferay-multi-vm-clustered.xml
cluster.link.enabled=true
lucene.replicate.write=true
ehcache.cluster.link.replication.enabled=true
web.server.display.node=true
org.quartz.jobStore.isClustered=true
3. Add jvmRoute parameter in both node's /opt/liferay/tomcat-7.0.27/conf/server.xml file.
before:
<Engine name="Catalina" defaultHost="localhost" >
After:
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
note: here in node1 we are using jvm1 as jvmRoute. But in node2 you should use jvm2 as jvmRoute.
4. Now add below cluster snippet in tomcat/conf/server.xml file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> |
5. Now Add <distributable/> in /opt/liferay/tomcat-7.0.27/webapps/ROOT/WEB-INF/web.xml before </web-app>.
6. Now extract below two files from liferay-portal-src-6.1.20-ee-ga2-20120731110418084/portal-impl/src/ehcache. And add these files at /opt/liferay/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/myehcache folder.
liferay-multi-vm-clustered.xml
hibernate-clustered.xml
7. Now start both Liferay nodes.
Configuration at Web server.
Here I assume that you have configured mod_jk module with Apache. So I have shown load balancer configuration of worker.properties file only.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker.list=loadbalancer | |
worker.jvm1.port=8009 | |
worker.jvm1.host=192.168.186.161 | |
worker.jvm1.type=ajp13 | |
worker.jvm1.lbfactor=1 | |
worker.jvm1.max_packet_size=65536 | |
#worker.jvm1.socket_timeout=60 | |
#worker.jvm1.connection_pool_timeout=60 | |
worker.jvm2.port=8009 | |
worker.jvm2.host=192.168.186.162 | |
worker.jvm2.type=ajp13 | |
worker.jvm2.lbfactor=1 | |
worker.jvm2.max_packet_size=65536 | |
#worker.jvm2.socket_timeout=60 | |
#worker.jvm2.connection_pool_timeout=60 | |
worker.loadbalancer.type=lb | |
worker.loadbalancer.balance_workers=jvm1,jvm2 | |
worker.loadbalancer.sticky_session=1 | |
worker.jvm1.socket_keepalive=1 | |
worker.jvm2.socket_keepalive=1 | |
worker.loadbalancer.method=B |
You can mount it using below command.
JkMount /* loadbalancer
JkMount /* loadbalancer
Hi Alpesh,
ReplyDeleteGreat Article of configuring Liferay Cluster between two node cluster.
Hi Alpesh, Its Very Nice Article.....
ReplyDelete