3 Replies Latest reply on May 14, 2012 1:10 PM by sannegrinovero

    Indexes and dist cache mode

    dushyanttiwari

      I am using dist mode with >1 noOfOwners for availability. Also the cache items are indexed. I indexed them in the ram and seems to work fine. But certainly this cannot work in case of a node failure.

      Can you please tell me how to ensure that the index created is replicated to the owning nodes so that in case of failures one would not lose indexes? I tried mode "infinispan" but seems like I am missing some jars. Can you chalk out step by step how to do it and which jars to include?

      Also a concern that I have is I want the index to be colocated with the data so that there will be minimal remote reads and the application logic will ensure that operations are carried out on the owning node.

       

      Isn't there a built in easy way for this?

       

      Thanks,

      Dushyant

        • 1. Re: Indexes and dist cache mode
          galder.zamarreno

          Did you read https://docs.jboss.org/author/x/xgU5 at all? It explains strategies to manage indexes.

          • 2. Re: Indexes and dist cache mode
            dushyanttiwari

            Yeah I have gone through the resource. The link talks about what to do in theory, not the implementation. I figured out we need to create indexes as

             

             

             

             

             

             

             

            <indexing enabled="true" indexLocalOnly="true">

             

            <properties>

             

            <property name="hibernate.search.default.directory_provider" value="infinispan"/>

             

            </properties>

             

            </indexing>

             

            But even with this the following is resulting in a index loss: when the owner of the data goes down the new owner will not have an index.(dist mode) Hence asked for a step by step implementation so that I know what am I doing wrong. So please suggest - already lost a lot of time on this.

             

            The hibernate documentation suggested using the same cache manager using jndi but even without it, the indexing should work.

             

            Also my suggestion is to keep this abstract from the developer in the upcoming release. i.e let the indexing be handled by the framework itself. Because for dist mode if we have local indexes (ram) it would make no sense as the indexes are lost on a node failure.

             

            • 3. Re: Indexes and dist cache mode
              sannegrinovero

              Hi,

               


              Also my suggestion is to keep this abstract from the developer in the upcoming release. i.e let the indexing be handled by the framework itself. Because for dist mode if we have local indexes (ram) it would make no sense as the indexes are lost on a node failure.

               

              Yes we're aware that this is currently pretty hard to do, I agree we should make it easier in future.

               

              To resolve your question on the missing jars: we generally assume users are familiar with Maven dependencies; the needed dependencies are those defined in the Hibernate Search project, specifically:

              • org.infinispan:infinispan-lucene-directory
              • org.hibernate:hibernate-search-infinispan

              If you don't use Maven, you can download them from the Hibernate Search distribution https://sourceforge.net/projects/hibernate/files/hibernate-search/4.1.1.Final/

               

              On how to configure it: I'd highly recommend to reset the Hibernate Search documentation at http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/#infinispan-directories , in addition to Infinispan's own documentation.