saidone.org -
ribbed for her pleasure!
Main menu
Development
Mailing lists
About

Swamp
Links
ush.it
aghers.org
saidone@ush
gameknot
virtualmagister

Misc
Alfresco sticky client sessions with simple repository clustering HowTo - posted by saidone on Wed, 17 Sep 2008 15:34:02 GMT
In this example we'll setup a simple Alfresco Enterprise cluster on JBoss 4.0.5.GA, with a single NFS shared content store, L2 cache replication and Lucene indexes synchronization.

Environment setup
Prerequisites
A typical and legacy enterprise configuration, with Java 5 and JBoss 4.0.x up and running.
MySQL (used on this example) or another of (hibernate) supported databases.
Alfresco Enterprise Edition version 2.2.0 war bundle (actually mainly the .war file and the extension directory with the configuration files).

1. NFS stuff
Create nfs share mount point:
# mkdir -p /opt/share/alf_data_cluster
and a place for local indexes:
# mkdir -p /opt/alf_data
then map the drive for export, adding the following line to /etc/exports:
/opt/share/alf_data_cluster	192.168.1.231(rw)
(of course you've got to specify all the IPs of you cluster's nodes) and then reload the configuration file:
# /usr/sbin/exportfs -a
or start/restart nfs service:
# service nfs restart

2. Configuration stuff
Copy the extension directory on /path/to/jboss/server/yourserver/conf/alfresco and chdir to it.
Modify the custom-repository.properties, to separate the content store from local indexes:
dir.root=/opt/share/alf_data_cluster
dir.indexes=/opt/alf_data
within this file, set up lucene index synchronization by adding:
index.tracking.cronExpression=0/5 * * * * ?
index.recovery.mode=AUTO
Configure also the database, with the jdbc connection string and the driver name:
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco
And tell hibernate which dialect to use in the file custom-hibernate-dialect.properties:
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
Setup L2 cache replication by renaming copying the sample file:
# mv cp ehcache-custom.xml.sample.cluster ehcache-custom.xml
feel free to modify some properties, expecially you may want to change the multicast address and/or the port modifying these:
multicastGroupAddress=230.0.0.1,
multicastGroupPort=4446
Reduce the log verbosity, otherwise alfresco will try to open an X debugger. The quickest way is to modify the root category on /opt/jboss/server/default/conf/log4j.xml, setting the priority value to "INFO":
<root>
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="FILE"/>
        <priority value="INFO" />
</root>

3. Mangling and deploying alfresco.war on JBoss
Keep in mind that we're not deploying Alfresco on Tomcat. We have to slightly tweak the .war file to make all things working properly.
These are the simple steps I've tested:
- unzip the .war - remove log4j and jta jars from WEB-INF/lib - put in WEB-INF/lib the jdbc driver for the database you want to connect, if not present on your JBoss installation - inside WEB-INF, create a file named jboss-web.xml containing this:
<jboss-web>
        <class-loading>
                <loader-repository>Alfresco.ClassLoader:loader=alfresco.classloader</loader-repository>
        </class-loading>
        <context-root>alfresco</context-root>
</jboss-web>
- replace the jsf-libs in jboss/server/default/deploy/jbossweb-tomcat55.sar/sf-libs with the ones bundled with the .war
WEB-INF/lib/commons-lang-2.1.jar
WEB-INF/lib/commons-codec-1.3.jar
WEB-INF/lib/jstl-1.1.0.jar
WEB-INF/lib/commons-beanutils-1.7.0.jar
WEB-INF/lib/myfaces-api-1.1.5.jar
WEB-INF/lib/commons-collections-3.1.jar
WEB-INF/lib/commons-digester-1.6.jar
WEB-INF/lib/myfaces-impl-1.1.5.jar
- re-zip the war and copy it to deploy directory

4. JVM tuning and startup
To startup alfresco and make something useful you should at least increase the permanent generation size to 128MiB, but is recommended to increase also the heap size. Here's an example of recommended settings:
JAVA_OPTS= 
-server 
-Xcomp 
-Xbatch 
-Xss1024K 
-Xms1G 
-Xmx2G 
-XX:+UseConcMarkSweepGC 
-XX:+CMSIncrementalMode 
-XX:NewSize=512m 
-XX:MaxPermSize=128M 
-XX:CMSInitiatingOccupancyFraction=80 




No comments yet.



Post a new comment

<-- comment title (well, not really mandatory)
<-- your name
<-- your e-mail
<-- multiply 76 by 50

back to home
[[[[[[[ served by kugelmass ]]]]]]]
Computers are useless. They can only give you answers. - Pablo Picasso