具有共享索引的Infinispan分布式群集 [英] Infinispan distributed cluster with shared index

查看:138
本文介绍了具有共享索引的Infinispan分布式群集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人有一个工作示例,说明如何使用infinispan目录提供程序配置节点集群以共享索引?关于Infinispan的所有文档(文档严重缺乏顺便说一句)意味着它应该像设置一些属性一样简单,但无论我如何尝试我都无法使其工作。群集中的节点找到彼此正常,我可以在一个节点上获取操作并获取放在另一个节点上的对象。但是一旦我查询(使用索引),它就会开始失败。



我的infinispan配置:

 < global> 
< transport clusterName =SomeCluster>
< properties>
< property name =configurationFilevalue =jgroups-udp.xml/>
< / properties>
< / transport>
< / global>
< namedCache name =access>
< clustering mode =distribution/>
< indexing enabled =trueindexLocalOnly =true>
< properties>
< property name =default.directory_providervalue =infinispan/>
< property name =default.worker.backendvalue =jgroups/>
< / properties>
< / indexing>
< / namedCache>

我还没有找到一个覆盖带共享索引的分布式缓存的示例/教程,我认为我的google-fu很棒。我已经在infinispan社区论坛上询问过但没有得到任何回复。



我得到的错误都与只有一个节点可以写入的事实有关索引(主节点),但上面的配置,根据Hibernet搜索的一些文档应该使一个节点成为主节点,尽我所能,什么也不做。



<编辑:我使用Infinispan 6.0.2.Final

解决方案

而不是JGroups后端我会使用InfinispanIndexManager - 这个经理已经提供自己的后端。

 < indexing enabled =trueindexLocalOnly =true> 
< properties>
< property name =default.indexmanagervalue =org.infinispan.query.indexmanager.InfinispanIndexManager/>
< property name =default.exclusive_index_usevalue =false/>
< property name =default.metadata_cachenamevalue =lucene_metadata_repl/>
< property name =default.data_cachenamevalue =lucene_data_dist/>
< property name =default.locking_cachenamevalue =lucene_locking_repl/>
< property name =lucene_versionvalue =LUCENE_36/>
< / properties>
< / indexing>

现在,配置要集群(分布式或复制)的所有缓存。如果不以这种方式指定缓存配置,则使用默认缓存配置创建三个缓存 - 默认情况下为非群集配置。
我不确定exclusive_index_use,但也许没有必要。



我同意Infinispan文档可能会好得多,通常我必须回退到调查源代码。有关索引配置的示例,您可以查看infinispan-query模块/ src / test / resources。


Does anybody have a working example of how to configure a cluster of nodes to share an index using the infinispan directory provider? All the documentation on Infinispan (the documentation is seriously lacking btw) implies that it should be as easy as having some properties set but no matter how I try I cannot get it to work. The nodes in the cluster find eachother fine and I can do get operations on one node and get object that were put on another. But as soon as I do queries (use the index) it just starts to fail.

My infinispan config:

<global>
        <transport clusterName="SomeCluster">
            <properties>
                <property name="configurationFile" value="jgroups-udp.xml" />
            </properties>
        </transport>
    </global>
    <namedCache name="access">
        <clustering mode="distribution" />
        <indexing enabled="true" indexLocalOnly="true">
            <properties>
                <property name="default.directory_provider" value="infinispan"/>
                <property name="default.worker.backend" value="jgroups"/>
            </properties>
        </indexing>
    </namedCache>

I have not found one example/tutorial which covers a distributed cache with a shared index, and I consider my google-fu to be great. I have asked on the infinispan community forum but havent gotten any replies there.

The errors I get are all related to the fact that only one node can be able to write to the index (the master node) but the config above, which according some the documentation on Hibernet Search should make one node a master node, does nothing as far as I can se.

Edit:Im using Infinispan 6.0.2.Final

解决方案

Rather than JGroups backend I'd use InfinispanIndexManager - this manager already provides its own backend.

<indexing enabled="true" indexLocalOnly="true">
   <properties>
      <property name="default.indexmanager" value="org.infinispan.query.indexmanager.InfinispanIndexManager" />
      <property name="default.exclusive_index_use" value="false" />
      <property name="default.metadata_cachename" value="lucene_metadata_repl" />
      <property name="default.data_cachename" value="lucene_data_dist" />
      <property name="default.locking_cachename" value="lucene_locking_repl" />
      <property name="lucene_version" value="LUCENE_36" />
   </properties>
</indexing>

Now, configure all the caches to be clustered (distributed or replicated). Without specifying the cache configuration this way, the three caches are created using the default cache configuration - which is by default non-clustered. I am not sure about the exclusive_index_use, though, maybe it's not necessary.

I agree that Infinispan documentation could be much better, usually I have to fallback to investigating source code. For examples of indexing configuration, you can look into the infinispan-query module/src/test/resources.

这篇关于具有共享索引的Infinispan分布式群集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆