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

Version 1 Next »

Scenario

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

repository.xml

  • add a new repository configuration
    • point to a jackrabbit configuration file which has the Cluster element defined
    <!-- 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}" />
    </Repository>
  • add a mapping to the clustered repository for the workspace
        <RepositoryMapping>
            <Map name="website" repositoryName="magnolia" workspaceName="website" />
            <Map name="config" repositoryName="magnolia" workspaceName="config" />
            <Map name="users" repositoryName="magnolia" workspaceName="users" />
            <Map name="userroles" repositoryName="magnolia" workspaceName="userroles" />
            <Map name="usergroups" repositoryName="magnolia" workspaceName="usergroups" />
            <Map name="mgnlSystem" repositoryName="magnolia" workspaceName="mgnlSystem" /> <!-- System internal data -->
            <Map name="mgnlVersion" repositoryName="magnolia" workspaceName="mgnlVersion" /> <!-- magnolia version workspace -->
            <Map name="forum" repositoryName="magnoliacluster" workspaceName="forum" />
        </RepositoryMapping>
    

jackrabbit configuration file

  • make sure that all instances will point to the same database
  • 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="schema" value="mysql"/> 
          <param name="schemaObjectPrefix" value="JOURNAL_"/> 
        </Journal>
      </Cluster>
    

cluster id

notes

workspace.xml not rewritten
subscribers

  • No labels