-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate search, Infinispan and clustering on JBoss
PostPosted: Mon Aug 19, 2013 2:30 pm 
Newbie

Joined: Mon Aug 19, 2013 2:08 pm
Posts: 1
Hi All
I am new to using Hibernate Search and I am trying to use Hibernate Search with Infinispan as the default directory_provider . I have successfully configured for local mode and I want extend the application to support clustering on JBoss Application server. With the current configuration I am unable to get the indexed Inifinispan data replicated to the other instance on the cluster. Any hint or help about this problem is welcome and below are my configurations. If you need any more information please let me know.

What is missing here in-order to get the clustering working.

Hibernate property file

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
${connection.driver_class}
</property>
<property name="hibernate.connection.url">
${connection.url}
</property>
<property name="packagesToScan">org.jboss.as.quickstarts.hibernate_search.model.data</property>
<property name="hibernate.connection.username">${connection.username}</property>
<property name="hibernate.connection.password">${connection.password}</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">false</property>
<property name="dialect">${connection.dialect}</property>
<property name="hibernate.search.default.directory_provider">infinispan</property>
<property name="hibernate.search.lucene_version">LUCENE_35</property>
<property name="hibernate.search.analyzer">org.apache.lucene.analysis.standard.StandardAnalyzer</property>
<property name="key2StringMapperClass">org.infinispan.lucene.LuceneKey2StringMapper</property>
<property name="hibernate.search.infinispan.configuration_resourcename">hibernatesearch-infinispan.xml</property>
<property name="hibernate.search.infinispan.chunk_size">40960</property>
<property name="hibernate.search.default.exclusive_index_use">true</property>
</session-factory>
</hibernate-configuration>

hibernatesearch-infinispan.xml

<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
xmlns="urn:infinispan:config:5.1">

<!-- *************************** -->
<!-- System-wide global settings -->
<!-- *************************** -->

<global>

<!-- Duplicate domains are allowed so that multiple deployments with default configuration
of Hibernate Search applications work - if possible it would be better to use JNDI to share
the CacheManager across applications -->
<globalJmxStatistics
enabled="true"
cacheManagerName="HibernateSearch"
allowDuplicateDomains="true" />

<!-- If the transport is omitted, there is no way to create distributed or clustered
caches. There is no added cost to defining a transport but not creating a cache that uses one,
since the transport is created and initialized lazily. -->
<transport
clusterName="HibernateSearch-Infinispan-cluster">
<properties>
<property name="configurationFile" value="jgroups-tcp.xml" />
</properties>

<!-- Note that the JGroups transport uses sensible defaults if no configuration
property is defined. See the JGroupsTransport javadocs for more flags -->
</transport>

<!-- Note that the JGroups transport uses sensible defaults if no configuration property
is defined. See the Infinispan wiki for more JGroups settings:
http://community.jboss.org/wiki/ClusteredConfigurationQuickStart -->

<!-- Used to register JVM shutdown hooks. hookBehavior: DEFAULT, REGISTER, DONT_REGISTER.
Hibernate Search takes care to stop the CacheManager so registering is not needed -->
<shutdown
hookBehavior="DONT_REGISTER" />

</global>

<!-- *************************** -->
<!-- Default "template" settings -->
<!-- *************************** -->

<default>

<locking
lockAcquisitionTimeout="20000"
writeSkewCheck="false"
concurrencyLevel="500"
useLockStriping="false" />

<!-- Invocation batching is required for use with the Lucene Directory -->
<invocationBatching
enabled="true" />

<!-- This element specifies that the cache is clustered. modes supported: distribution
(d), replication (r) or invalidation (i). Don't use invalidation to store Lucene indexes (as
with Hibernate Search DirectoryProvider). Replication is recommended for best performance of
Lucene indexes, but make sure you have enough memory to store the index in your heap.
Also distribution scales much better than replication on high number of nodes in the cluster. -->
<clustering
mode="d">

<!-- Prefer loading all data at startup than later -->
<stateTransfer
timeout="480000"
fetchInMemoryState="true" />

<!-- Network calls are synchronous by default -->
<sync
replTimeout="20000" />
</clustering>

<jmxStatistics
enabled="true" />

<eviction
maxEntries="-1"
strategy="NONE" />

<expiration
maxIdle="-1" />

</default>

<!-- ******************************************************************************* -->
<!-- Individually configured "named" caches. -->
<!-- -->
<!-- While default configuration happens to be fine with similar settings across the -->
<!-- three caches, they should generally be different in a production environment. -->
<!-- -->
<!-- Current settings could easily lead to OutOfMemory exception as a CacheStore -->
<!-- should be enabled, and maybe distribution is desired. -->
<!-- ******************************************************************************* -->

<!-- *************************************** -->
<!-- Cache to store Lucene's file metadata -->
<!-- *************************************** -->
<namedCache
name="LuceneIndexesMetadata">
<clustering
mode="d">
<stateTransfer
fetchInMemoryState="true" />
<sync
replTimeout="25000" />
</clustering>
</namedCache>

<!-- **************************** -->
<!-- Cache to store Lucene data -->
<!-- **************************** -->
<namedCache
name="LuceneIndexesData">
<clustering
mode="d">
<stateTransfer
fetchInMemoryState="true" />
<sync
replTimeout="25000" />
</clustering>
</namedCache>

<!-- ***************************** -->
<!-- Cache to store Lucene locks -->
<!-- ***************************** -->
<namedCache
name="LuceneIndexesLocking">
<clustering
mode="replication">
<stateTransfer
fetchInMemoryState="true" />
<sync
replTimeout="25000" />
</clustering>
</namedCache>

</infinispan>


jgroups-tcp.xml

<config xmlns="urn:org:jgroups"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-3.0.xsd">
<TCP
bind_addr="GLOBAL"
bind_port="7800"
loopback="true"
port_range="30"
recv_buf_size="20m"
send_buf_size="640k"
discard_incompatible_packets="true"
max_bundle_size="64000"
max_bundle_timeout="30"
enable_bundling="true"
use_send_queues="true"
enable_diagnostics="false"
bundler_type="old"

thread_naming_pattern="pl"

thread_pool.enabled="true"
thread_pool.min_threads="2"
thread_pool.max_threads="30"
thread_pool.keep_alive_time="60000"
thread_pool.queue_enabled="true"
thread_pool.queue_max_size="100"
thread_pool.rejection_policy="Discard"

oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="2"
oob_thread_pool.max_threads="30"
oob_thread_pool.keep_alive_time="60000"
oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Discard"
/>


<TCPPING timeout="3000"
initial_hosts="localhost[7800],172.16.200.75[7800]"
port_range="1"
num_initial_members="2"
ergonomics="false"
/>

<VERIFY_SUSPECT timeout="1500" />
<pbcast.NAKACK
use_mcast_xmit="false"
retransmit_timeout="300,600,1200,2400,4800"
discard_delivered_msgs="true"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
max_bytes="400000"/>
<pbcast.GMS print_local_addr="true" join_timeout="3000"
view_bundling="true"/>

</config>

Thank You,
Tharindu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.