Hi,
we are using Hibernate Search with success on a productive system. The setup is a high availability cluster (Linux-HA) with two servers. At every time one instance is the master, but on both systems the application is running. Each application has its own Lucene directory on its server. The database is replicated. If the active server fails for whatever reason, Heartbeat will switch over to the hot standby server. This works great for the application and the database.
But here comes the problem: As every application instance has its own Lucene directory, the Lucene index isn't up to date after switching.
What is the preferred Lucene / Hibernate Search configuration for a hot standby setup like ours, with instant failover capabilities?
I read about clustering and the possibilities with FSMasterDirectoryProvider and the JMS solution as well. But I don't feel that it works for my situation, because the update interval is very long (default 60 Minutes). The application must be aware of index changes nearly instantly, so it wouldn't be a solution to sync every 5 Minutes or so, because data were still lost, if the master switch occured after - let's say - 4 Minutes.
And the described solutions are nearly always, that a single instance is the index master and the slaves are just reading the index.
In our case, we want to be able to switch the application to let the hot standby application become the new master.
Some questions, which came to my mind on this topic:
- Is it possible to synchronize the Lucene directory from master server to the slave server via a hardware synchronize solution?
- Does Hibernate Search/Lucene recognizes changes made to the Lucene FS directory, when the application is running? Or are information held in memory additionally?
- Is it possible to force a FSMasterDirectoryProvider to synchronize from sourceBase upon becoming the active server?
- Can I assume, that the Lucene directory is NOT touched by Lucene, if there are no interactions with the database?
- Is it possible to let two applications work simultaneously on the same Lucene directory if parallel access is precluded by the HA setup? After a switch, would the new master pick up the changes in the Lucene directory made by the other master before switching the master?
Thank you in advance for your help.