shuber 2005/11/24 12:25:53 CET
Modified files:
core/src/webapp/html/startup howto_cluster.html
Removed files:
. TRANSACTIONS-HOWTO.txt
Log:
Complete overhaul of clustering and transactions howto. Full documentation is
in HTML file now.
Revision Changes Path
1.3 +0 -95 jahia/TRANSACTIONS-HOWTO.txt (dead)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/TRANSACTIONS-HOWTO.txt?rev=1.2&content-type=text/plain
1.8 +127 -35 jahia/core/src/webapp/html/startup/howto_cluster.html
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/html/startup/howto_cluster.html.diff?r1=1.7&r2=1.8&f=h
Index: howto_cluster.html
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/webapp/html/startup/howto_cluster.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- howto_cluster.html 24 Nov 2005 10:23:39 -0000 1.7
+++ howto_cluster.html 24 Nov 2005 11:25:53 -0000 1.8
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
-<title>Jahia Readme</title>
+<title>Jahia Clustering, Transactions and DB Storage Howto</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
@@ -35,7 +35,7 @@
font-size : 14px;
color : #999999;
}
-DIV.box { width : 190px;
+DIV.box { width : 150px;
color : #666666;
font-family : Arial, Helvetica, sans-serif;
float : left;
@@ -86,8 +86,9 @@
width : 768px;
clear : both;
}
-.code { font-family : "Courier New", Courier, mono;
- font-size : 11px;
+.code {
+ font-family : "Courier New", Courier, mono;
+ font-size : 11px;
}
span.red { color : #B42C29; }
-->
@@ -107,14 +108,12 @@
documentation and much more. <br/>
</div>
</div>
- <div class="maincontent">
- <h1>How to setup clustering and database content storage of large
data</h1>
- <p>
+ <div class="maincontent">
+ <h1>How to setup clustering, database content storage of large data
and transactions </h1>
+<p>
If you want to activate the
clustering configuration, you should
- modify a few configuration
files.<br/>
- </p>
- <p>
- <h2>I - To activate in base content storage</h2>
+ modify a few configuration
files. </p>
+ <h2>I - To activate in base content storage</h2>
To setup in base content storage, you
just have to select "in base storage" during the
configuration wizard, in the database
advanced configuration screen.<br/><br/>
<b>Please note that currently,
in base content storage does not work with PostgreSQL. This will be fixed
@@ -132,13 +131,10 @@
[mysqld]<br/>
max_allowed_packet=16M
</p>
- will limit the maximum size for each
file stored in the database to 16 Megabytes.
- <br/><br/>
- </p>
- <p>
- <h2>II - To setup and activate the clustering feature</h2>
+ <p>will limit the maximum size for each
file stored in the database to 16 Megabytes. </p>
+ <h2>II - To setup and activate the
clustering feature</h2>
This howto describe the procedure when
2 Jahia nodes are setup in cluster; if more nodes are used, follow the same
- procedure for all nodes.<br/>
+<br/>
<ol>
<li>Install the first instance
as for a stand-alone configuration.<br/>
During the
configuration wizard, select "in base content storing" if you prefer to store
all
@@ -176,21 +172,20 @@
<li>Modify the
<i>jahia/WEB-INF/classes/treecache.xml</i> file and replace the following line
:<br/>
<p class="code"><attribute
name="CacheMode">LOCAL</attribute></p>
<p>with the line </p>
- <p class="code"><attribute
name="CacheMode">REPL_ASYNC</attribute><br/>
- </p>
+ <p class="code"><attribute
name="CacheMode">REPL_ASYNC</attribute></p>
</li><li>Modify the
<i>jahia/WEB-INF/etc/spring/applicationcontext-services.xml</i>
and set the value of the
parameter <property name="activated"> to <b>true</b> in the
<i>ClusterService</i> bean
<br/>(<i><bean id="ClusterService"
parent="txProxyTemplate"></i>).<br/><br/>
A <b>different</b>
server ID is also required for each node of the cluster. This should also be
modified in the
<i>applicationcontext-services.xml</i> file :
-<p class="code">
- <bean id="ClusterNodeSettings"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+<pre class="code"><bean id="ClusterNodeSettings"
+
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
- <props>
- <prop key="serverId"><span
class="red">jahiaServer1</span></prop>
- </props>
+ <props>
+ <prop key="serverId"><span
class="red">jahiaServer1</span></prop>
+ </props>
</property>
- </bean></p>
+</bean></pre>
</li>
<li>Modify the
<i>jahia/WEB-INF/etc/spring/applicationcontext-dao.xml</i> and set the value of
the parameter <property name="clusterActivated"> to <b>true</b>
in the <i>idGeneratorDAO</i> bean <br/>
(<i><bean
id="idGeneratorDAO"
class="org.jahia.hibernate.dao.IDGeneratorDAO"
init-method="start" destroy-method="stop"></i>).<br />
@@ -204,11 +199,11 @@
To change the multicast
address, you should <br/><br/>
i) modifiy the following line
in the
<i>jahia/WEB-INF/classes/treecache.xml</i> file :<br/>
- <p class="code"> <UDP
mcast_addr="231.12.21.140" mcast_port="45010"<br />
-ip_ttl="64" ip_mcast="true"<br />
-mcast_send_buf_size="150000"
mcast_recv_buf_size="80000"<br />
-ucast_send_buf_size="150000"
ucast_recv_buf_size="80000"<br />
-loopback="false"/></p>
+ <pre class="code"><UDP
mcast_addr="231.12.21.140" mcast_port="45010"
+ ip_ttl="64" ip_mcast="true"
+ mcast_send_buf_size="150000"
mcast_recv_buf_size="80000"
+ ucast_send_buf_size="150000"
ucast_recv_buf_size="80000"
+ loopback="false"/></pre>
In the above tag,
modify the <span class="code">231.12.21.140</span> with any unused IP address
within the reserved multicast IP ranges as documented here :
http://www.iana.org/assignments/multicast-addresses. Make sure also that if you
have
bridge, switch or hub
hardware between the Jahia installations that it does forward UDP multicast
packets.<br/>
@@ -224,17 +219,114 @@
the output console when starting each
jahia node :<br/>
<br/>
<p class="code">GMS: address is
ip_address:port</p>
- where <i>ip_address</i> is the local
IP address of the node, and <i>port</i> the port used to communicate
+ <p>where <i>ip_address</i> is the
local IP address of the node, and <i>port</i> the port used to communicate
with other Jahia nodes.<br/>
<br/>
<span class="red">Make sure
that if you have a firewall installed, it does not have filering enabled for
the ports used to send
and receive the
packets. The following error in the console may indicate such problem :<br/>
<br/>
[org.jgroups.protocols.UDP] ERROR - exception=java.net.BindException: Cannot
assign requested address: Datagram send failed, msg=[ds
- 1.12.21.133:45000, src:
192.168.2.130:1664 (2 headers), size = 0 bytes], mcast_addr=231.12.21.133:45000
- </span>
- </p><br/><br/><br/><br/>
- </div>
+ 1.12.21.133:45000, src:
192.168.2.130:1664 (2 headers), size = 0 bytes], mcast_addr=231.12.21.133:45000
</span>
+ </p>
+ </p>
+ <h2>III - To setup and activate
transactions</h2>
+ <p>Introduction
</p>
+ <p>Jahia can now be configured to use transactions, and will soon
require this in order to guarantee data integrity. Clustering setups also
<strong>require</strong> transactions to be setup properly. This howto explains
how to setup transactions with Tomcat, but it is also possible to use the
default transaction manager of a J2EE application server, such as Apache
Geronimo or JBoss. This guide only explains the steps to configure transactions
with Tomcat.</p>
+ <p>Requirements : </p>
+ <ul>
+ <li>JOTM 2.0.10 available at : <a
href="http://jotm.objectweb.org/">http://jotm.objectweb.org/</a></li>
+ <li>Tomcat 5.5 available at : <a
href="http://jakarta.apache.org/tomcat">http://jakarta.apache.org/tomcat</a></li>
+ <li> Jahia 5.0 available at : <a
href="http://www.jahia.net">http://www.jahia.net</a></li>
+ </ul>
+ <p>On Tomcat 5.5 :</p>
+ <ol>
+ <li>Remove jta*.jar and geronimo-jta*.jar from
tomcat/webapps/jahia/WEB-INF/lib<br />
+ </li>
+ <li> From JOTM lib directory, copy the following JARs
into tomcat/common/lib<br />
+ <ul>
+ <li>commons-cli-1.0.jar</li>
+ <li>commons-logging.jar</li>
+ <li>connector-1_5.jar</li>
+ <li>howl.jar</li>
+ <li>jotm.jar</li>
+ <li>jotm_jrmp_stubs.jar</li>
+ <li>jta-spec1_0_1.jar</li>
+ <li>jts1_0.jar</li>
+ <li>objectweb-datasource.jar</li>
+ <li>ow_carol.jar</li>
+ <li>xapool.jar</li>
+ </ul></li>
+ <li> Copy your database driver into the
tomcat/common/lib directory<br />
+ </li>
+ <li> Install Jahia<br />
+ </li>
+ <li> In tomcat/conf/Catalina/localhost/jahia.xml,
uncomment the following lines :<br />
+ <br />
+ <pre class="code"><Resource
name="UserTransaction" auth="Container"
+ type="javax.transaction.UserTransaction"
+ factory="org.objectweb.jotm.UserTransactionFactory"
+ jotm.timeout="60"/></pre>
+ Also change this line :<br />
+ <br />
+ <pre class="code"><Resource
name="jdbc/jetspeed" auth="Container"
+ factory="org.apache.commons.dbcp.BasicDataSourceFactory"
+ type="javax.sql.DataSource" username="jahia"
password="jahia"
+ driverClassName="org.postgresql.Driver"
url="jdbc:postgresql:jahia"
+ maxActive="100" maxIdle="30"
maxWait="10000"/></pre>
+ to : <br />
+ <br />
+ <pre class="code"><Resource
name="jdbc/jetspeed" auth="Container"
+ factory="org.objectweb.jndi.DataSourceFactory"
+ type="javax.sql.DataSource" username="jahia"
password="jahia"
+ driverClassName="org.postgresql.Driver"
url="jdbc:postgresql:jahia"
+ maxActive="100" maxIdle="30"
maxWait="10000"/></pre>
+ </li>
+ <li>In
tomcat/webapps/jahia/WEB-INF/classes/treecache.xml, uncomment the following
line : <br />
+ <br />
+ <pre class="code"><attribute
name="TransactionManagerLookupClass">
+ org.jahia.services.cache.jboss.TomcatTransactionManagerLookup
+</attribute></pre>
+ </li>
+ <li> In
tomcat/webapps/jahia/WEB-INF/etc/spring/applicationcontext-hibernate.xml,
uncomment the following line :<br />
+ <br />
+ <pre class="code"><prop
key="hibernate.transaction.factory_class">
+ org.hibernate.transaction.JTATransactionFactory
+</prop></pre>
+ </li>
+ <li> In
tomcat/webapps/jahia/WEB-INF/etc/spring/applicationcontext-hibernate.xml,
uncomment the following lines :<br />
+ <br />
+ <pre class="code"><bean
id="transactionManager"
+
class="org.springframework.transaction.jta.JtaTransactionManager">
+ <property name="userTransactionName">
+ java:comp/env/UserTransaction
+ </property>
+</bean></pre>
+ and comment the following lines : <br />
+ <br />
+ <pre class="code"><bean
id="transactionManager"
+
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <property name="sessionFactory">
+ <ref local="sessionFactory"/>
+ </property>
+ <property name="nestedTransactionAllowed">
+ <value>@NESTED_TRANSACTION_ALLOWED@</value>
+ </property>
+</bean></pre>
+ </li>
+ <li> In tomcat/common/classes, add the following file
:<br />
+ <br />
+ carol.properties, with the following content
(without the BEGIN and END lines) : <br />
+ <br />
+ <pre class="code">-- BEGIN --
+carol.protocols=jrmp
+carol.start.jndi=false
+carol.start.ns=false
+carol.start.rmi=false
+carol.jndi.java.naming.factory.url.pkgs=org.apache.naming
+-- END --</pre>
+ </li>
+ </ol>
+ </div>
<div class="footer">
Copyright 2005, <a href="http://www.jahia.org">Jahia Ltd</a> - All
rights reserved
</div>