2

私は、Hibernate Search を使用する Web アプリを作成しているチームの一員です。最近、JGroups の使用を実装して、異なるノードの Lucene インデックスを相互に同期させようと試みました。

ただし、このセットアップを行うための最も基本的な最初のステップを通過することができず、ドキュメントもかなりまばらに見えます。

<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="myFactory">
<property name="dataSource" ref="myDataSource"/>
<property name="persistenceXmlLocation" value="/WEB-INF/persistence.xml"/>
<property name="persistenceUnitName" value="persistenceUnit"/>
<property name="jpaVendorAdapter" ref="vendorAdapter"/>
<property name="jpaProperties">
    <props>
        <prop key="hibernate.search.worker.backend.jgroups.configurationFile">jgroups-config.xml</prop>
        <prop key="hibernate.search.default.directory_provider">infinispan</prop>
        <prop key="hibernate.search.default.indexBase">indexes</prop>
        <prop key="hibernate.search.default.worker.backend">jgroups</prop>
        <prop key="hibernate.search.services.jgroups.clusterName">MyCluster</prop>
        <prop key="hibernate.search.error_handler">log</prop>
        <prop key="hibernate.search.lucene_version">LUCENE_36</prop>
        <prop key="hibernate.search.generate_statistics">true</prop>
        <prop key="hibernate.search.jmx_enabled">true</prop>
    </props>
</property>

ここで重要なプロパティはhibernate.search.worker.backend.jgroups.configurationFile、最終的に必要になる jgroups の構成ファイルの名前を指定することです。このファイルを WEB-INF に入れ、JBoss モジュールのディレクトリ構造 (他のファイルが配置され、正常にロードされる) の props ファイルに入れようとしましたが、取得されません。

私が見ることができるログで:

16:34:57,609 INFO  [org.hibernate.search.backend.impl.jgroups.JGroupsChannelProvider] (MSC service thread 1-1) HSEARCH000005: Starting JGroups Channel
16:34:57,609 INFO  [org.hibernate.search.backend.impl.jgroups.JGroupsChannelProvider] (MSC service thread 1-1) HSEARCH000011: Unable to use any JGroups configuration mechanisms provided in properties { hibernate.search.default.worker.backend=jgroups, hibernate.search.default.directory_provider=infinispan, hibernate.search.worker.backend.jgroups.configurationFile=jgroups-config.xml}. Using default JGroups configuration file!
16:34:59,427 INFO  [stdout] (MSC service thread 1-1) 
16:34:59,427 INFO  [stdout] (MSC service thread 1-1) -------------------------------------------------------------------
16:34:59,428 INFO  [stdout] (MSC service thread 1-1) GMS: address=LDNLPT1271-PC-17149, cluster=CrisisHubCluster, physical address=172.26.10.169:58147
16:34:59,428 INFO  [stdout] (MSC service thread 1-1) -------------------------------------------------------------------
16:35:02,448 INFO  [org.hibernate.search.backend.impl.jgroups.JGroupsMasterMessageListener] (MSC service thread 1-1) HSEARCH000015: Received new cluster view: [LDNLPT1271-PC-17149|0] [LDNLPT1271-PC-17149]
16:35:02,450 INFO  [org.hibernate.search.backend.impl.jgroups.JGroupsChannelProvider] (MSC service thread 1-1) HSEARCH000006: Connected to cluster [ MyCluster ]. The node address is LDNLPT1271-PC-17149
16:35:02,513 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (CacheStartThread,HibernateSearch-Infinispan-cluster,LuceneIndexesMetadata) ISPN000078: Starting JGroups Channel
16:35:02,514 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (CacheStartThread,HibernateSearch-Infinispan-cluster,LuceneIndexesMetadata) ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!

プロパティのリストは数ページを占めるので切り詰めましたUnable to use any JGroups configuration mechanisms provided in propertiesが、行を見ると、プロパティがリストされていると同時に、プロパティが見つからないことが示されていることがわかります。

そのため、構成ファイルの場所を取得しておらず、デフォルトを使用しています。

Hibernate Search で jgroups を使用した人はいますか? カスタム jgroups 構成ファイルを提供できましたか? どうやってそれをしましたか?

4

1 に答える 1