Can someone share a working configuration file for Infinispan cluster (tcp or udp) working with Hibernate search. I am running into several issues making the infinispan cluster work reliably.
To begin with I used the default jgroups-udp config file but was seeing random dropped message errors between nodes. So I moved to tcp with JDBC_PING as the PING protocol. It seemed at least the cluster formed correctly and the messages were being exchanged correctly but then I started running into locking issues when multiple nodes try to write at the same time. So again used the jgroups backend to have a dynamically elected master for performing writes.
At this point I am running into issues where if I run MassIndexer on the Jgroups master node (writer), the searches do not return any results. However, if I run the MassIndexer on any non JGroups master node, the search works fine on all nodes include the master node.
I am not sure if I am missing something in the configuration or there are some shortcomings of the infinispan cluster. Here is what I am using for my configuration
My versions are
Hibernate search: 4.5.0 Final
Infinispan: 6.0.1.Final
hibernate-search-jgroups-tcp.xml
Code:
<config xmlns="urn:org:jgroups"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.4.xsd">
<TCP
bind_addr="${jgroups.tcp.address:GLOBAL}"
bind_port="${jgroups.tcp.port:7800}"
loopback="true"
port_range="30"
recv_buf_size="20000000"
send_buf_size="640000"
max_bundle_size="31k"
use_send_queues="true"
sock_conn_timeout="300"
enable_diagnostics="true"
bundler_type="old"
thread_pool.enabled="true"
thread_pool.min_threads="2"
thread_pool.max_threads="30"
thread_pool.keep_alive_time="60000"
thread_pool.queue_enabled="false"
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"
internal_thread_pool.enabled="true"
internal_thread_pool.min_threads="1"
internal_thread_pool.max_threads="10"
internal_thread_pool.keep_alive_time="60000"
internal_thread_pool.queue_enabled="true"
internal_thread_pool.queue_max_size="100"
internal_thread_pool.rejection_policy="Discard"
/>
<JDBC_PING connection_driver="org.postgresql.Driver"
connection_password="${jgroups_db_password}"
connection_url="jdbc:postgresql://${jgroups_db_host}:${jgroups_db_port}/jgroupsdb?ssl=true"
connection_username="${jgroups_db_user}"
/>
<MERGE2 max_interval="30000"
min_interval="10000"/>
<FD_SOCK/>
<FD timeout="3000" max_tries="5"/>
<VERIFY_SUSPECT timeout="1500"/>
<pbcast.NAKACK2
use_mcast_xmit="false"
xmit_interval="1000"
xmit_table_num_rows="100"
xmit_table_msgs_per_row="10000"
xmit_table_max_compaction_time="10000"
max_msg_batch_size="100"/>
<UNICAST3
xmit_table_num_rows="20"
xmit_table_msgs_per_row="10000"
xmit_table_max_compaction_time="10000"
max_msg_batch_size="100"
conn_expiry_timeout="0"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
max_bytes="400000"/>
<pbcast.GMS print_local_addr="true" join_timeout="7000" view_bundling="true"/>
<pbcast.FLUSH/>
<tom.TOA/> <!-- the TOA is only needed for total order transactions-->
<!-- <UFC max_credits="2m" min_threshold="0.40"/> -->
<MFC max_credits="2m" min_threshold="0.40"/>
<FRAG2 frag_size="30k" />
<RSVP timeout="60000" resend_interval="500" ack_on_delivery="false"/>
</config>
Hibernate search properties
Code:
<property name="hibernate.search.default.exclusive_index_use" value="false"/>
<property name="hibernate.search.services.jgroups.clusterName" value="tenant-schema-cluster"/>
<property name="hibernate.search.infinispan.configuration_resourcename" value="hibernate-search-tenant-infinispan.xml"/>
<property name="hibernate.search.default.worker.backend" value="jgroups"/>
<property name="hibernate.search.services.jgroups.configurationFile" value="hibernate-search-jgroups-tcp.xml"/>
<property name="hibernate.search.default.jgroups.block_waiting_ack" value="false"/>