7 Replies Latest reply: Aug 14, 2012 3:04 AM by Horia Chiorean RSS

Configuring Modeshape 3 to use Infinispan + Amazon S3

Michael Bruno Newbie

Hello,

 

We have Modeshape 3 Beta1 installed onto JBoss AS7. We are trying to figure out how to enable persistence from Infinispan into an Amazon S3 bucket. It's our understanding that all configuration (Modeshape+Infinispan+AS7) should be in a single file now, in our case standalone-modeshape.xml. While it seems easy enough to configure infinispan plus a basic repository, there doesn't appear to be any documented mechansims to persist to an S3 bucket. The few examples we found on this site and elsewhere seem to refer to either earlier versions of modeshape, or alternate configuration files (repository-name.json, etc.).

 

So our two questions are:

 

  1. Is it possible to configure everything inside standalone-modeshape.xml?
  2. If not, what is the recommended configuration practice? If we need to use alternate configuration files (like a repository-name.json), how do we reference them within standalone-modeshape.xml, or is there a specific directory in which JBoss will automatically look?

 

Any pointers or examples would be helpful!

  • 1. Re: Configuring Modeshape 3 to use Infinispan + Amazon S3
    Randall Hauch Master
    1. Is it possible to configure everything inside standalone-modeshape.xml?

    Yes, that is exactly where you configure the ModeShape repositories and Infinispan caches. The "standalone-modeshape.xml" file is one example of a configuration file for the standalone mode of AS7. You can have several, and even create your own configuration files and specify them when you start AS7.

     

    As for the Infinispan / S3 configuration, I don't have anything handy. But check out the XSDs in the "docs/schema" directory of your AS7 installation; there should be one for each subsystem, including 3 versions of the Infinispan subsystem (use the latest version). It basically should entail defining "store" element (rather than a "file-store") with the various properties for the S3 cache loader.

     

    Hope that helps!

  • 2. Re: Configuring Modeshape 3 to use Infinispan + Amazon S3
    Walter Sze Newbie

    Can you tell me which cache loader to use for S3?  I thought org.infinispan.loaders.cloud.CloudCacheStore would be the correct one since it implemented org.infinispan.loaders.CacheLoader, but I'm getting the following on starting up jboss using standalone-modeshape.xml error:

     

    Pool -- 32) JBAS014612: Operation ("add") failed - address: ([

        ("subsystem" => "infinispan"),

        ("cache-container" => "modeshape"),

        ("local-cache" => "xxx")

    ]): java.lang.IllegalArgumentException: org.infinispan.loaders.cloud.CloudCacheStore is not a valid cache store

        at org.jboss.as.clustering.infinispan.subsystem.CacheAdd.buildCacheStore(CacheAdd.java:545)

        at org.jboss.as.clustering.infinispan.subsystem.CacheAdd.processModelNode(CacheAdd.java:426)

        at org.jboss.as.clustering.infinispan.subsystem.CacheAdd.performRuntime(CacheAdd.java:165)

        at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:50) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

        at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

        at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

  • 3. Re: Configuring Modeshape 3 to use Infinispan + Amazon S3
    Randall Hauch Master

    The CloudCacheStore is indeed the one to use, but it's hard to tell what went wrong without a listing of the Infinispan and ModeShape sections of the XML file. Can you post them?

  • 4. Re: Configuring Modeshape 3 to use Infinispan + Amazon S3
    Walter Sze Newbie

    Sorry for the delay.  I added my configuration to the standalone-modeshape.xml from modeshape-3.0.0.Beta2-jbossas-7-dist:

     

    <server xmlns="urn:jboss:domain:1.2">

        <extensions>

             :

        </extensions>

        <management>

             :

        </management>

        <profile>

             :

            <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">

                  :

            <local-cache name="xxx">

                <store class="org.infinispan.loaders.cloud.CloudCacheStore" preload="true" purge="false">

                    <property name="identity">{s3_accessKeyId}</property>

                    <property name="password">{s3_secretAccessKey}</property>

                    <property name="bucketPrefix">{s3_bucket}</property>

                    <property name="requestTimeout">20000</property>

                    <property name="cloudService">s3</property>

                    <property name="secure">true</property>

                    <property name="compress">true</property>

                </store>

            </local-cache>

        </profile>

        <interfaces>

             :

        </interfaces>

        <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

            :

        </socket-binding-group>

    </server>

     

    Thanks

  • 5. Re: Configuring Modeshape 3 to use Infinispan + Amazon S3
    Horia Chiorean Master

    Looking at what's packaged inside of AS 7.1.1, it seems to me that it doesn't come with the CloudCacheStore support at all (as far as the contents of the ISPN modules go).

    There is this issue https://issues.jboss.org/browse/AS7-1827 with the resolution "Deffered"  and a fix version of 7.1.0.CR1 - not sure what this means

  • 6. Re: Configuring Modeshape 3 to use Infinispan + Amazon S3
    Walter Sze Newbie

    Thanks for the info.  I tried adding the missing jar by:

     

    1. Adding "<module name="org.infinispan.cachestore.cloud"/>" to /modules/org/jboss/as/clustering/infinispan/main/module.xml inside "<dependencies>"

    2. Copied infinispan-cachestore-cloud-5.1.5.CR1.jar to /modules/org/infinispan/cachestore/cloud/main

     

    So on starting AS7, I can see this is now being loaded in the boot.log:

    16:51:25,956 DEBUG [org.jboss.modules] Module org.infinispan.cachestore.cloud:main defined by local module loader @1f78040 (roots: /Users/{user}/jboss-as-7.1.1.Final/modules)

     

    But I'm getting the same error.  I'm not sure if I did this correctly.  It was just a shot in the dark.

     

    One strange thing I found was if I changed the class to something that didn't exist (example: org.infinispan.loaders.cloud.CloudCacheStoreXXX) I still get the same error.  I assumed it should return a Class Not Found Exception.

     

     

    Any help would be greatly appreciated.

     

     

    Thanks

  • 7. Re: Configuring Modeshape 3 to use Infinispan + Amazon S3
    Horia Chiorean Master

    I think the first step is making sure ISPN cloud configuration is correctly set-up in AS 7.1.1. Maybe a question (with what you just described previously) here https://community.jboss.org/en/jbossas7/dev would help.