You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jake Gillespie <jd...@gmail.com> on 2017/01/03 18:20:35 UTC
How to load plugins with Solr 4.9 and SolrCloud
Hi everyone,
I'm trying to load a custom plugin with Solr 4.9. I'm able to do this
running Solr 4.9 on a single server but not when running as a cluster. I'm
hoping for some advice on how best to move forward, whether it be
configuring the current infrastructure correctly or upgrading Solr.
When running on a single server, I followed the instructions here
<https://wiki.apache.org/solr/SolrPlugins>. In short, I placed the jar in a
directory on the server, added this directory using the sharedLib attribute
to solr.xml and then used the lib directive in solrconfig.xml to point to
this jar.
In cluster mode, I've tried the following:
- Adding the plugin with the blob store API as per the instructions here
<https://cwiki.apache.org/confluence/display/solr/Adding+Custom+Plugins+in+SolrCloud+Mode>.
However, the blob store API is added in Solr 5.0.
- Adding the plugin as in the single server case. However, the <solr>
tag in solr.xml appears to ignore the sharedLib attribute when running in
SolrCloud.
Does anyone know if it's possible to run custom plugins in SolrCloud with
Solr 4.9? If so, are you able to see where I'm going wrong? I can provide
more detail on either of my attempted solutions if pertinent. If it's not
possible, I'll look into upgrading Solr.
Any advice would be appreciated.
Thanks,
Jake
Re: How to load plugins with Solr 4.9 and SolrCloud
Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/3/2017 11:20 AM, Jake Gillespie wrote:
> When running on a single server, I followed the instructions here
> <https://wiki.apache.org/solr/SolrPlugins>. In short, I placed the jar
> in a directory on the server, added this directory using the sharedLib
> attribute to solr.xml and then used the lib directive in
> solrconfig.xml to point to this jar.
If you use sharedLib (which defaults to ${solr.solr.home}/lib) for this,
then you don't need the <lib> directive. Using the <lib> directive as
well as sharedLib will load the jar at least twice. Not only does this
have the potential to waste memory, but loading some jars twice will
actually break them.
For either standalone or cloud mode, just remove all lib-related config
(including sharedLib), and place all extra jars into
${solr.solr.home}/lib on every server. This location is automatically
loaded by Solr, without any config. The same goes for a lib directory
inside the core's instanceDir.
The blob store API isn't available in 4.9, and even on the versions
where it is present, will only work for classes in solrconfig.xml.
Classes in the schema won't use the blob store.
See this issue for a discussion about Solr's classloader and some of the
problems that can happen:
https://issues.apache.org/jira/browse/SOLR-4852
Thanks,
Shawn