Hey Thorben,
First of all, I completely understand your desires/requirements and
also your suggested approaches. See some extra comments on top of the
ones from Bart below
On Thu, Jun 2, 2016 at 8:24 PM, Bart van der Schans
<
b.vande...@onehippo.com> wrote:
> Hi Thorrben,
>
> You can't share the lucene index between cluster nodes. Jackrabbit,
> which is what our repository is built upon, does not support it and it
> will break. Each cluster node needs full control over its own index.
> This is part of the core of Jackrabbit and not something that can be
> changed.
Indeed it is correct that Jackrabbit does not support it. Even if
Jackrabbit would support it, then we'd most likely end up with some
cluster nodes having to access a remote filesystem (assuming not all
cluster nodes run on the same machine). And this doesn't work out well
with Lucene. See [1]. Remote index searches are in general too slow.
Wrt to your second approach, there is currently a limitation in
Jackrabbit that makes it at this moment not possible: Jackrabbit keeps
the last lucene index it has in memory (next to a redo log on FS) for
some time (say couple of seconds) and flushes it to disk after some
time has passed or after it contains a certain amount of new indexed
documents. This results however in it that you cannot rely on the
filesystem index only: A snapshot of the filesystem might miss some
part which is kept in memory. So, for now, your second approach also
does not (yet) work. I write (yet) because I've been experimenting
some time ago with supporting taking correct lucene index snapshots
from a running repository. The results seemed quite ok, but it was
still in poc phase. Namely for our on demand offering, we want the
same thing you are after : Quick recovery / rollback / horizontal
scaling if required.
Unfortunately, for you at this moment, it is thus not yet possible.
The only way that is currently supported is as follows : If the
loadbalancer hits, say, two cluster nodes, you can keep a third slave
node up. If it gets more busy, you shut down the third node (then the
in memory index is flushed to disk as well). Then copy the instance to
the fourth cluster node. Start up the third cluster node again and the
fourth. Add the third to the load balancer and keep the fourth running
as slave (the slave gets all the changes and updates the index all the
time).
I understand this is a really poor mans horizontal scaling approach.
That is why I had been working on the poc to be able to take a lucene
index snapshot. Once we have that productized, the second suggestion
you had is the way to go.
HTH,
Regards Ard
[1]
https://wiki.apache.org/lucene-java/ImproveSearchingSpeed
Hippo Netherlands, Oosteinde 11, 1017 WT Amsterdam, Netherlands
Hippo USA, Inc. 71 Summer Street, 2nd Floor Boston, MA 02110, United
states of America.
US
+1 877 414 4776 (toll free)
Europe
+31(0)20 522 4466
www.onehippo.com