You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Vjger <ma...@libero.it> on 2009/08/05 17:09:20 UTC

Cluster configuration and JBoss JCA

Hi to all.
I'm trying to understand how works the cluster configuration. I read teh
wiki page http://wiki.apache.org/jackrabbit/Clustering but I've some doubts.

I persist the data on FileSystem and I use the JCA Connector for JBoss with
his configuration datasource jcr-ds.xml.

Actually, without cluster, this is my repository.xml
<?xml version="1.0"?>

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

<Repository>
 
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        
    </FileSystem>

    <Security appName="Jackrabbit">

        <SecurityManager
class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
workspaceName="security">
         </SecurityManager>

        <AccessManager
class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
        </AccessManager>

    </Security>

    <Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>
    <Workspace name="${wsp.name}">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
          
    			
    			 
        </PersistenceManager>

        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            
            
            
            
        </SearchIndex>
    </Workspace>

    <Versioning rootPath="${rep.home}/version">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
          
    			
    			 
        </PersistenceManager>
    </Versioning>

    <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        
        
        
        
    </SearchIndex>
    
</Repository>


My jcr-ds.xml is 

<?xml version="1.0" encoding="UTF-8"?>
<connection-factories> 
    <tx-connection-factory>
		<jndi-name>jcr/local</jndi-name> 
		<xa-transaction/>
		<rar-name>jackrabbit-jca-1.5.6.rar</rar-name>
		<connection-definition>javax.jcr.Repository</connection-definition>
		<config-property name="homeDir"
type="java.lang.String">C:\jackrabbit\myRepository</config-property>
		<config-property name="configFile"
type="java.lang.String">classpath:repository.xml</config-property>
		<config-property name="bindSessionToTransaction"
type="java.lang.Boolean">true</config-property>
    </tx-connection-factory>
</connection-factories>

Well, if I share the folder for the repository (for instance,
Y:\jackrabbit\myRepository), how I must configure the two jcr-ds.xml and the
two repository.xml into the two nodes of my cluster?

If the "homeDir" points to the repository folder, it doesn't "found" the
repository configuration file (which is on another path). So, I suppose that
into homeDir I would put the repository.xml path folder and after, into the
two <cluster> what I must write?

Supposing that my first node has the repository.xml into
C:\jackrabbit\myRepository, my second node into D:\jackrabbit\myRepository
and my shared folder is Y:\jackrabbit\myRepository (seen by the two nodes
both), how i must configure the two jcr-ds.xml and the two <cluster> tag
into the two repository.xml?

Besides, I've seen that when JBoss creates an instance of
javax.jcr.Repository, it locks the repository itself with the .lock file.
How can the clustering work when the repository is locked by one of the
nodes?

Thans in advance.
-- 
View this message in context: http://www.nabble.com/Cluster-configuration-and-JBoss-JCA-tp24829725p24829725.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Cluster configuration and JBoss JCA

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Aug 6, 2009 at 12:07 PM, Vjger<ma...@libero.it> wrote:
> My problem arises because JBoss will work in cluster configuration and, if I
> point the different nodes the same repository, which is on FileSystem, the
> first who opens the Repositiry connection locks it and so, the other nodes
> are blocked to use it.
>
> IS IT POSSIBLE AVOID THIS PROBLEM?

No, the files (eg. file system persistence manager, search index,
nodetype/namespace xml, etc.) of a single repository can only be used
by one running Jackrabbit instance. That's why clustering exists,
which in conjunction of a persistence manager that allows for
concurrent access and a journal handles the required synchronization.

> I presumed using the Jackrabbit Cluster Configuration: now it is correct BUT
> in any case, the two repository don't communicate between them even if the
> journal file is created into the shared area.
>
> IS IT CAUSED BECAUSE I'M USING A FILE SYSTEM BASED PERSISTENCE MANAGER?

Yes, the file system persistence manager is not cluster-able. As noted
on http://wiki.apache.org/jackrabbit/Clustering :

"When using Jackrabbit, one option is to use a database persistence
manager, and use a database that does support concurrent access. The
file system based persistence managers in Jackrabbit are not
transactional and don't support concurrent access; Apache Derby
doesn't support concurrent access in the embedded mode."

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Cluster configuration and JBoss JCA

Posted by Vjger <ma...@libero.it>.


Vjger wrote:
> 
> Hi to all.
> I'm trying to understand how works the cluster configuration. I read teh
> wiki page http://wiki.apache.org/jackrabbit/Clustering but I've some
> doubts.
> 
> 

Ok, I've understood a lot of doubts but I've problems too.

My problem arises because JBoss will work in cluster configuration and, if I
point the different nodes the same repository, which is on FileSystem, the
first who opens the Repositiry connection locks it and so, the other nodes
are blocked to use it.

IS IT POSSIBLE AVOID THIS PROBLEM?

I presumed using the Jackrabbit Cluster Configuration: now it is correct BUT
in any case, the two repository don't communicate between them even if the
journal file is created into the shared area.

IS IT CAUSED BECAUSE I'M USING A FILE SYSTEM BASED PERSISTENCE MANAGER?

This is my configuration:

Two JBoss server with a JCA Connector and a jcr-ds.xml that points to his
repository (/MyRepo1/repository.xml and /MyRepo2/repository.xml)

Into /MyRepo1/repository.xml

        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
          
    			
    			 
        </PersistenceManager>

    <Cluster id="node1">
		  <Journal class="org.apache.jackrabbit.core.journal.FileJournal">
		    
		    
		  </Journal>
		</Cluster>


Into /MyRepo2/repository.xml

        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
          
    			
    			 
        </PersistenceManager>

    <Cluster id="node2">
		  <Journal class="org.apache.jackrabbit.core.journal.FileJournal">
		    
		    
		  </Journal>
		</Cluster>


I see that when the first JBOss starts, into the Repo1 folder the
revision.log file is created and into C:\jackrabbitShared there are
journal.log and revision files. The same when starts the second JBoss.

BUT, if I - for instance - create a document with the first web application,
it is not visible from the second web application. I.E., the two
repositories are not synchronized.


There is a way to avoid the locking of repository by .lock file? This would
be the better solution because all the JBoss nodes will point only one
shared repository.

Any suggest?


Thanks in advance

-- 
View this message in context: http://www.nabble.com/Cluster-configuration-and-JBoss-JCA-tp24829725p24841087.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.