集群配置中的Hibernate搜索? [英] Hibernate Search in a Clustered Configuration?

查看:149
本文介绍了集群配置中的Hibernate搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我正在开发的Java Web应用程序,使用JBoss Seam作为应用程序框架。我想利用Hibernate Search来提供实体搜索功能。整合已经很好,我正在接近部署。生产中应用程序的设置为:


  • 2个(或更多)Tomcat应用服务器,负载均衡

  • PostgreSQL数据库在后端



我的问题是,如何配置Hibernate Search以便更新本地Lucene索引在应用程序服务器#2上实体在应用程序服务器#1上持久保存时,反之亦然? Hibernate Search是否有任何种类的集群配置支持?这个设置必须要有一定的主控权,因为任何一个负载均衡的应用服务器上都会出现持久性问题。



有没有人对如何解决这个问题提出任何建议?感谢您的帮助! 正如给出了这个方向的指针(我不知道它是否工作正常,甚至根本不行)。


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!

解决方案

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:

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).

这篇关于集群配置中的Hibernate搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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