留言板

What happens if external Solr shuts down?

thumbnail
Marcus Hjortzén,修改在9 年前。

What happens if external Solr shuts down?

Junior Member 帖子: 45 加入日期: 12-5-2 最近的帖子
Hi!

We're looking into moving the lucene indexes from local disk to an external solr server.
One of the apparent risks with doing that is that we get totally dependent on another server and the network in between, since it is still within the same hosting site chances are that this won't be an issue but there are other scenarios where we would like to take the solr server offline (regular maintenence etc).

How does Liferay (configured with solr-web 4) handle it if the external solr server goes offline?
What are the consequences?

Kind regards,
Marcus
thumbnail
David H Nebinger,修改在9 年前。

RE: What happens if external Solr shuts down? (答复)

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
So you should not be using a single instance anyway.

You want a cluster of SOLR nodes behind a load balancer. This offers you some protection against outage of a single node. An odd number of SOLR nodes works best, and choosing a number depends upon how much you're going to be indexing. With a larger SOLR cluster, you should consider zookeeper to minimize management and configuration tasks for the cluster.

As far as a failure to find SOLR, well the effect is the same as if you delete the lucene index while Liferay is running. The index is incomplete and records are just not found (such as going to the user control panel to see all users and finding none even though they are still in the database).

It won't shut Liferay down, but it will certainly affect it's ability to function correctly.

In an enterprise environment, you would want to establish a monitoring process to ensure SOLR is up and functional in the same way as you'd be monitoring your Liferay environment. Outages in SOLR should be treated in the same way as you'd treat an outage of Liferay.
thumbnail
Marcus Hjortzén,修改在9 年前。

RE: What happens if external Solr shuts down?

Junior Member 帖子: 45 加入日期: 12-5-2 最近的帖子
Thank you David for much appreciated input!

Our immediate problem is individual indexes on two machines, in a EE hot spare scenario (no clustering, just a failover machine). Since they don't share a common index different data is being shown depending on which node is currently active. Anyway, solving this with an external SolR seemed like the most obvious and perhaps fastest way.

I did some tests in local environment with a LR running local lucene indexes, then using solr-web and external solr. In this case when I shut the solr process down, my Liferay still shows me results.
I am guessing that the local (but at this point in time, stale) lucene indexes are kicking in, but that's just a guess. However, it could be enough for our maintenence scenarios, if we could build local indexes the night before shutting down the solr process.

Anyway, that solution has "hack" written all over it and the proper solution would involve clustering. Even if doing clustering is a big step in regards of infrastructure but also in terms of knowing how to tune and maintain a cluster of solr's.

Thank you for your input!

//Marcus
thumbnail
David H Nebinger,修改在9 年前。

RE: What happens if external Solr shuts down?

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
I can't see that the hot spare scenario would work unless you were replicating the index from the primary to the spare (who knows, solr may support such a thing, I'm not a solr expert).

Even if Liferay were falling back to a local lucene index (which I'd find hard to believe), using solr over time the lucene index would get more and more stale (Liferay pushes results to the solr index only, doesn't try to do solr and lucene...
thumbnail
Olaf Kock,修改在9 年前。

RE: What happens if external Solr shuts down?

Liferay Legend 帖子: 6396 加入日期: 08-9-23 最近的帖子
You don't need to stress your beliefs: With the integrations that I know, Liferay is using either Lucene (Standard) or SOLR (with a plugin), but never falls back from one to another (When indexing requests are sent to SOLR, they're not sent to Lucene, so Lucene does not have any clue what kind of data you're working with).

There's another functionality that allows you to replicate the lucene indexing requests (it's mentioned in the documentation). Positive: You don't need external search integration. Negative: Requires full reindex after you reboot a server (because you might have missed some indexing requests). If you can live with the reindexing (e.g. it's done in a minute) this might be an option to keep them in sync.

Here's the default:

    # Set this to true if you want the portal to replicate an index write across
    # all members of the cluster. This is useful in some clustered environments
    # where you wish each server instance to have its own copy of the Lucene
    # search index. This is only relevant when using the default Lucene indexing
    # engine.
    #
    lucene.replicate.write=false
thumbnail
Marcus Hjortzén,修改在9 年前。

RE: What happens if external Solr shuts down?

Junior Member 帖子: 45 加入日期: 12-5-2 最近的帖子
Thank you Olaf for the suggestion!
Our reindex task runs for 3 hours, so I guess that an external search integration is the way to go for us emoticon

//M