Showing posts with label Clustering. Show all posts
Showing posts with label Clustering. Show all posts

Liferay 6.1 Cluster Configuration using Multicast

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

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.

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.
You can mount it using below command.
JkMount /* loadbalancer

Alfresco Cluster Validation


This post would be helpful, if you have setup the Alfresco cluster and found issues(L2 cache replication, Startup error, failed cluster message transmission,etc). Below mentioned points should be taken care before you start testing Cluster in Alfresco.
(1) Make sure the hostname of both Alfresco server are reachable on Resolved IP address.
Ex: you can check with "hostname" command. This command will give you hostname. After that you can try to ping hostname. If you are getting output like "Reply from...", that means hostname is rechable. If you are not getting any other message, then contact system Admin.
(2) Validate Max Open File limit is configured. By default, it is 1024. You can check if Max Open File limit using below command.
First login with the user, by which you are going to start Alfresco. Then run below command.
ulimit -Hn
ulimit -Sn
If you are getting output of above command as "1024" or less. Then modify  /etc/security/limits.conf file and add below lines. Here we are considering that Alfresco is running as "alfresco" user.
alfresco soft nofile 1024
alfresco hard nofile 10240
After you give this command, restart the server. Then check again with ulimit command.
(3) Check if firewall is on or off. If firewall is on in Server, then you may need to open Open ports. Port depends on the setup of Alfresco Custer.
(4) Validate the Java version is Sun JDK.
(5) Validate that the directory in which Alfresco is installed does not contain spaces.
(6) Validate that the directory in which the JVM is installed does not contain spaces.
(7) Validate that the directory Alfresco will use for the repository (typically called alf_data) is both readable and writeable by the operating system user that the Alfresco process will run as.
(8) Validate that you can connect to the database as the Alfresco database user, from the Alfresco server. And you have provided proper library file to connect.
(9) Validate that the character encoding for the Alfresco database is UTF-8. (MySQL only) Validate that the storage engine for the Alfresco database is InnoDB.
(10) If you are using Openoffice then make sure that OpenOffice is able to run in headless mode