Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate Search in a Clustered Configuration?

I have a Java web app that I'm developing, using JBoss Seam as the application framework. I'd like to take advantage of Hibernate Search to provide entity searching capabilities. The integration has gone fine, and I'm getting closer to deployment. The setup for the app in production will be:

  • 2 (or more) Tomcat app servers, load balanced
  • PostgreSQL database on the backend

My question is, how can I configure Hibernate Search so that the local Lucene indices are updated on App Server #2 when an entity is persisted on App Server #1, and vice versa? Does Hibernate Search have any sort of clustered-configuration support? The setup would have to be somewhat master-master since the persist could occur on either of the load-balanced app servers.

Does anyone have any recommendations on how to tackle this? Thanks for your help in advance!

like image 827
Shadowman Avatar asked Oct 07 '11 20:10

Shadowman


1 Answers

As describe in the reference documentation there are several back end types:

  • Lucene for non-clustered and
  • JMS or JGroups for clustered environments (sections 3.6. / 3.7), see this nice illustration from the docs:

enter image description here

There might be a way to use Terracotta, at least this post gives pointers in this direction (I don't know if it works well or even at all).

like image 165
jeha Avatar answered Oct 21 '22 14:10

jeha