You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by John Langley <la...@gmail.com> on 2011/02/13 19:25:15 UTC

cluster example using a datasource?

Does anyone have an example cluster configuration (repository.xml) they
could share that uses a DataSource?
I want to run in j2ee container like glassfish and use a database connection
pool for the database connections,
so a DataSource seems a natural way to do that.

Thanks in advance,

-- Langley

Re: cluster example using a datasource?

Posted by Kevin Jansz <ke...@exari.com>.
the example below is for a postgres database using JNDI to get the
connection in all instances ... includes the cluster config.

Note the "schemaObjectPrefix" values I'm using are bit long and in
most cases unnecessary for most definitions but the workspace - where
you must have "${wsp.name}" somewhere in the "schemaObjectPrefix"
parameter or the schemas will conflict (between "default" and
"security" for example).


<!DOCTYPE Repository
          PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
          "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
<!-- DB-based repository -->
<Repository>

    <!-- Repository store of  global state (e.g. registered
namespaces, custom node types, etc.) -->
    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
        <param name="driver" value="javax.naming.InitialContext" />
        <param name="url" value="java:comp/env/jdbc/jackrabbit" />
        <param name="schema" value="postgresql"/>
        <param name="schemaObjectPrefix" value="repository_fs_"/>
    </FileSystem>
    <!--
        DataStore is optionally used to store large binary values.
        http://wiki.apache.org/jackrabbit/DataStore
    -->
    <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
        <param name="driver" value="javax.naming.InitialContext"/>
        <param name="url" value="java:comp/env/jdbc/jackrabbit"/>
        <param name="databaseType" value="postgresql"/>
        <param name="schemaObjectPrefix" value="repository_ds_"/>
    </DataStore>

     <!-- Security configuration -->
    <Security appName="Jackrabbit">
        <SecurityManager
class="org.apache.jackrabbit.core.DefaultSecurityManager"
workspaceName="security"/>
        <AccessManager
class="org.apache.jackrabbit.core.security.DefaultAccessManager"/>
        <LoginModule
class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
           <param name="anonymousId" value="anonymous"/>
           <param name="adminId" value="admin"/>
        </LoginModule>
    </Security>

    <!-- Workspaces configuration root directory and name of default
workspace -->
    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>

    <!-- Template for workspace configuration -->
    <Workspace name="${wsp.name}">
        <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="java:comp/env/jdbc/jackrabbit" />
            <param name="schema" value="postgresql"/>
            <param name="schemaObjectPrefix" value="${wsp.name}_fs_"/>
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="java:comp/env/jdbc/jackrabbit" />
            <param name="schema" value="postgresql"/>
            <param name="schemaObjectPrefix" value="${wsp.name}_pm_"/>
        </PersistenceManager>
        <!-- Search index  (file-based - local per server) -->
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="supportHighlighting" value="true"/>
        </SearchIndex>
    </Workspace>

    <!-- Versioning configuration -->
    <Versioning rootPath="${rep.home}/version">
        <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="java:comp/env/jdbc/jackrabbit" />
            <param name="schema" value="postgresql"/>
            <param name="schemaObjectPrefix" value="version_fs_"/>
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="java:comp/env/jdbc/jackrabbit" />
            <param name="schema" value="postgresql"/>
            <param name="schemaObjectPrefix" value="version_pm_"/>
        </PersistenceManager>
    </Versioning>

    <!-- Search index for content that is shared repository wide
(/jcr:system tree, contains mainly versions) -->
    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="${rep.home}/repository/index"/>
        <param name="supportHighlighting" value="true"/>
    </SearchIndex>

    <!-- Cluster configuration -->
    <Cluster id="node1" syncDelay="2000">
        <Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
            <param name="driver" value="javax.naming.InitialContext"/>
            <param name="url" value="java:comp/env/jdbc/jackrabbit" />
            <param name="schema" value="postgresql"/>
            <param name="schemaObjectPrefix" value="jrnl_"/>
        </Journal>
    </Cluster>
</Repository>



--
Kevin Jansz
kevin.jansz@exari.com
Level 7, 10-16 Queen Street, Melbourne 3000 Australia
Tel +61 3 9621 2773 | Fax +61 3 9621 2776
Exari Systems
Boston | London | Melbourne | Munich
www.exari.com

Test drive our software online - www.exari.com/demo-trial.html
Read our blog on document assembly - blog.exari.com




On 14 February 2011 05:25, John Langley <la...@gmail.com> wrote:
> Does anyone have an example cluster configuration (repository.xml) they
> could share that uses a DataSource?
> I want to run in j2ee container like glassfish and use a database connection
> pool for the database connections,
> so a DataSource seems a natural way to do that.
>
> Thanks in advance,
>
> -- Langley
>