Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Your Rating: Results: 1 Star2 Star3 Star4 Star5 Star 1 rates

Scenario

We want the two public instances to share the comments which are stored in the forum workspace. But otherwise we want to keep the content independent.

see: http://documentation.magnolia-cms.com/technical-guide/clustering.html

repository.xml

  1. add a new repository configuration in .../WEB-INF/config/default/repositories.xml

        <!-- magnolia non-default repository -->
        <Repository name="magnoliacluster" provider="info.magnolia.jackrabbit.ProviderImpl" loadOnStartup="true">
            <param name="configFile" value="${magnolia.repositories.jackrabbit.cluster.config}" />
            <param name="repositoryHome" value="${magnolia.repositories.home}/magnoliacluster" />
            <!-- the default node types are loaded automatically
                <param name="customNodeTypes" value="WEB-INF/config/repo-conf/nodetypes/magnolia_nodetypes.xml" />
            -->
            <param name="contextFactoryClass" value="org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory" />
            <param name="providerURL" value="localhost" />
            <param name="bindName" value="cluster-${magnolia.webapp}" />
            <workspace name="forum" />
        </Repository>
    
  2. add a mapping to the clustered repository for the workspace to tell the system that this workspace lives in a different repository (the clustered one)

        <RepositoryMapping>
            <Map name="website" repositoryName="magnolia" workspaceName="website" />
            ...
            <Map name="forum" repositoryName="magnoliacluster" workspaceName="forum" />
        </RepositoryMapping>
    
  3. set magnolia.repositories.jackrabbit.cluster.config in the magnolia.poperties to whatever you will use for the configuration file below (e.g. "WEB-INF/config/repo-conf/clustered-jackrabbit-bundle-mysql-search.xml")

jackrabbit configuration file

see: http://wiki.apache.org/jackrabbit/Clustering

  1. make a copy of the non-clustering configuration file
  2. make sure that both the instances use the same underlaying database
  3. add the cluster configuration to the configuration file

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

Set the cluster id

The cluster id identifies the instance and is used to write changes to the journal as well as to load changes from the journal. Make sure this is a unique value and is not shared with the other nodes in the cluster.

Cluster id can be defined either in the properties file (most convenient way) or in the persistence manager in the cluster configuration (both ways are used in the attached files):

  <Cluster id="mclu1" syncDelay="2000">
   ....
  </Cluster>

Setting the cluster id in the properties file, will save you from having two different persistence manager files with just this little change.

  1. set magnolia.clusterid property in the magnolia.properties file

Subscribers

Make sure that the content is not activated to both the clustered instances.

  • only one subscriber should have a subscription to the clustered workspace(s) in /server/activation/subscribers/xxx/subscriptions

Warning: loading of workspace configuration

Once a workspace has been created a copy of jackrabbit configuration is saved to the workspace folder (workspace.xml)

  • changing the original jackrabbit configuration file won't have any effect
  • changes have to be made in the workspace.xml
  • No labels