Hi Michele,

You¹ll need to have two separate repo config files, one for each instance
that your clustering.  Try the following:

1. Revert the changes you made to jackrabbit-bundle-mysql-search.xml (you
can still use this configuration for the instances that aren¹t clustered
(i.e. Your local development environment, your author instance, etc.)
2. Copy jackrabbit-bundle-mysql-search.xml to a new file and rename it
jackrabbit-bundle-mysql-search-pub1.xml
3. Create another copy of jackrabbit-bundle-mysql-search.xml and rename it
jackrabbit-bundle-mysql-search-pub2.xml
4. Each clustered node needs to have it¹s own unique id, so open up and edit
jackrabbit-bundle-mysql-search-pub1.xml, add the following just after the
opening Repository tag.
  <!-- shared journal -->
  <Cluster id="cid_${YOUR_FIRST_SERVER_NAME_HERE}">
    <Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
     <param name="revision" value="${rep.home}/revision.log" />
     <param name="driver" value="com.mysql.jdbc.Driver" />
     <param name="url" value="jdbc:mysql://host1:3306/magnolia_public" />
     <param name="user" value="magnolia" />
     <param name="password" value="xxxxxxx" />
      <param name="schema" value="mysql" />  <!-- Note: The sample
configuration you sent had the name of this parameter as ³databaseType², I
believe this isn¹t correct.  It should be ³schema² instead. -->
      <param name="schemaObjectPrefix" value="journal_" />   <!-- Note: The
sample configuration you sent didn¹t contain this line, I believe you¹ll
need to add it. -->
    </Journal> 
  </Cluster>
5. Save the file.
6. Open up and edit jackrabbit-bundle-mysql-search-pub2.xml
7. You can copy the Cluster configuration above and place it just after the
opening Repository tag, make sure to change the id attribute to be unique,
(server name works nicely for me).
8. Create a new directory under WEB-INF/config named using your server name
for your first host: e.g. host1.mydomain.com
9. Inside that directory, create a another directory using your webapp's
name: e.g. magnoliaPublic
10. Inside the WEB-INF/config/host1.mydomain.com/magnoliaPublic directory
create a magnolia.properties file with the following configuration:

# host1.mydomain.com magnoliaPublic
# Magnolia Properties for host1.mydomain.com magnoliaPublic instance,
property values here override those set in default/magnolia.properties and
magnoliaPublic/magnolia.properties

# Persistence Manager Configuration for clustered node
magnolia.repositories.jackrabbit.config=WEB-INF/config/repo-conf/jackrabbit-
bundle-mysql-search-pub1.xml

11. Save this file.
12. Create a new directory under WEB-INF/config named using your server name
for your second host: e.g. host2.mydomain.com
13. Inside that directory, create a another directory using your webapp's
name: e.g. magnoliaPublic
14. Inside the WEB-INF/config/host2.mydomain.com/magnoliaPublic directory
create a magnolia.properties file with the following configuration:

# host2.mydomain.com magnoliaPublic
# Magnolia Properties for host2.mydomain.com magnoliaPublic instance,
property values here override those set in default/magnolia.properties and
magnoliaPublic/magnolia.properties

# Persistence Manager Configuration for clustered node
magnolia.repositories.jackrabbit.config=WEB-INF/config/repo-conf/jackrabbit-
bundle-mysql-search-pub2.xml
15. Save this file.
16. Create your war file then deploy it to your servers.  As long as the
directory names match your ${serverName} and ${webappName} they will use
those properties defined in those new magnolia.properties files, so
host1.mydomain.com will use the
magnolia.repositories.jackrabbit.config=WEB-INF/config/repo-conf/jackrabbit-
bundle-mysql-search-pub1.xml Persistance Manager configuration and
host2.mydomain.com will use the
magnolia.repositories.jackrabbit.config=WEB-INF/config/repo-conf/jackrabbit-
bundle-mysql-search-pub2.xml Persistance Manager configuration.

Have a look at the following documentation on the Magnolia Documentation
site for more information about how the configuration works:

Using a single WAR file with multiple configurations :
http://documentation.magnolia-cms.com/cookbook/using-a-single-war-file-with-
multiple-configurations.html

HTH,
Matt







From: Michele <[email protected]>
Reply-To: Magnolia User-List <[email protected]>
Date: Fri, 4 Feb 2011 18:19:00 +0100
To: <[email protected]>
Subject: [magnolia-user]  Magnolia 4.4 + MySQL clustering

I deployed Magnolia (community edition) 4.4 on Tomcat 6.0.
I need to build a cluster for load-balancing purposes to do some test on it.

Here's my situation:
- host1: MySQL db - magnolia_author, magnolia_public
- host2: magnoliaAuthor and magnoliaPublic instances
- host3: magnoliaPublic instance

I configured clustering (both on host2 and host3) in
magnoliaPublic/WEB-INF/config/repo-conf/jackrabbit-bundle-mysql-search.xml
in this way:

 <Cluster id="node2" syncDelay="2000">
    <Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
      <param name="revision" value="${rep.home}/revision.log" />
      <param name="driver" value="com.mysql.jdbc.Driver" />
      <param name="url" value="jdbc:mysql://host1:3306/magnolia_public" />
      <param name="user" value="magnolia" />
      <param name="password" value="xxxxxxx" />
      <param name="databaseType" value="mysql"/>
    </Journal>
  </Cluster>

Now on http://host3:8080/magnoliaPublic/ I can visualize correctly the
demo-project and I can update it by author instance on host2.
On http://host2/magnoliaPublic/ I see the homepage, but with a rough layout
(no background, only some images, etc...).

Cannot understand where I'm wrong.
Is the database infrastructure correct? What about
jackrabbit-bundle-mysql-search.xml configuration?
I read offical docs, but this points aren't clear.
I can post my catalina.out, if necessary.

Thank you anyone who can help me.




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to