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 Bob Cook <bc...@gmail.com> on 2017/01/03 02:07:25 UTC
Lib Directives in SolrConfig when using SolrCloud
I've create some custom plugin that I put in a lib directory at the same
level
as the conf directory for the core which is loaded via the lib directives
in solrconfig.xml
/solrdata/CoreName/conf
/solrdata/CoreName/lib
/solrdata/CoreName/core.properties
This works great when using Solr. But when I use SolrCloud, I get an error
when creating the collection as it can't find the plugin libraries. Now
that Zookeeper is managing the conf directory (configuration files, i.e.
solrconfig.xml), what is the relative path in solrconfig.xml pointing to?
how do I specify the relative path, or do I need to specify an absolute
path?
Or do I need to put the libraries somewhere else?
I did get this to work if I put them in the "sharedLib" directory as
defined by solr.xml, but
I don't want other collections to reference the sharedLib, they need to
reference their own.
Thanks,
Bob
Re: Lib Directives in SolrConfig when using SolrCloud
Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/3/2017 8:29 AM, Bob Cook wrote:
> Thanks Shawn. So I'm not insane!
>
> Is there a way to specify a "jar" load order?
> I'm trying to use UIMA's concept mapper and it requires a particular load
> order, otherwise it
> doesn't instantiate and errors out. I was able to do this with the "lib"
> directives.
The order that the filenames are returned is determined by Java, not by
Solr. The code uses a DirectoryStream<Path> object, part of NIO2 in
Java, so it's outside Solr's control entirely.
If load order actually matters, and renaming the jars so that an
alphanumeric sort would order them correctly doesn't produce the correct
result, then I think you'll probably need to place the jars in a
location that isn't special, and use the <lib> directive with absolute
paths. If more than one core has that config, then the jars will be
loaded more than once.
Thanks,
Shawn
Re: Lib Directives in SolrConfig when using SolrCloud
Posted by Bob Cook <bc...@gmail.com>.
Thanks Shawn. So I'm not insane!
Is there a way to specify a "jar" load order?
I'm trying to use UIMA's concept mapper and it requires a particular load
order, otherwise it
doesn't instantiate and errors out. I was able to do this with the "lib"
directives.
Thanks again.
Bob
On Tue, Jan 3, 2017 at 12:13 AM, Shawn Heisey <ap...@elyograg.org> wrote:
> On 1/2/2017 7:07 PM, Bob Cook wrote:
> > I've create some custom plugin that I put in a lib directory at the
> > same level as the conf directory for the core which is loaded via the
> > lib directives in solrconfig.xml /solrdata/CoreName/conf
> > /solrdata/CoreName/lib /solrdata/CoreName/core.properties This works
> > great when using Solr. But when I use SolrCloud, I get an error when
> > creating the collection as it can't find the plugin libraries. Now
> > that Zookeeper is managing the conf directory (configuration files,
> > i.e. solrconfig.xml), what is the relative path in solrconfig.xml
> > pointing to?
>
> I actually do not know what the path for lib directives is relative to
> when running SolrCloud. Most things in a core config are relative to
> the location of the config file itself, but in this case, the config
> file is not on the filesystem at all, it's in zookeeper, and I don't
> think Solr can use jars in zookeeper. Also there's a size limit of one
> megabyte for items in zookeeper without special config, and increasing
> the limit is not recommended.
>
> > how do I specify the relative path, or do I need to specify an
> > absolute path? Or do I need to put the libraries somewhere else?
>
> My recommendation: Do not use "lib" directives, or any other kind of
> jar-loading related config including sharedLib, at all. On each
> machine, create a "lib" directory in the solr home and place all your
> extra jars there. The solr home is where solr.xml lives and where the
> core directories normally go. All jars in this lib directory will be
> loaded exactly once at startup and made available to all cores, without
> *any* config.
>
> You can also create a lib directory inside the core's instanceDir, which
> is also automatically loaded by Solr without config, but this presents a
> bit of a catch-22 problem where you can't create the lib directory until
> the core exists, but can't get the core to work properly until the lib
> directory exists.
>
> There is a feature in SolrCloud for loading jars from a distributed
> collection. It doesn't work everywhere in Solr, but classes specified
> in solrconfig.xml, for things like request handlers, should work.
>
> https://cwiki.apache.org/confluence/display/solr/Blob+Store+API
>
> There is an enhancement request filed to allow the schema to use jars
> from the blob store, but it hasn't received much attention yet:
>
> https://issues.apache.org/jira/browse/SOLR-9175
>
> Thanks,
> Shawn
>
>
Re: Lib Directives in SolrConfig when using SolrCloud
Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/2/2017 7:07 PM, Bob Cook wrote:
> I've create some custom plugin that I put in a lib directory at the
> same level as the conf directory for the core which is loaded via the
> lib directives in solrconfig.xml /solrdata/CoreName/conf
> /solrdata/CoreName/lib /solrdata/CoreName/core.properties This works
> great when using Solr. But when I use SolrCloud, I get an error when
> creating the collection as it can't find the plugin libraries. Now
> that Zookeeper is managing the conf directory (configuration files,
> i.e. solrconfig.xml), what is the relative path in solrconfig.xml
> pointing to?
I actually do not know what the path for lib directives is relative to
when running SolrCloud. Most things in a core config are relative to
the location of the config file itself, but in this case, the config
file is not on the filesystem at all, it's in zookeeper, and I don't
think Solr can use jars in zookeeper. Also there's a size limit of one
megabyte for items in zookeeper without special config, and increasing
the limit is not recommended.
> how do I specify the relative path, or do I need to specify an
> absolute path? Or do I need to put the libraries somewhere else?
My recommendation: Do not use "lib" directives, or any other kind of
jar-loading related config including sharedLib, at all. On each
machine, create a "lib" directory in the solr home and place all your
extra jars there. The solr home is where solr.xml lives and where the
core directories normally go. All jars in this lib directory will be
loaded exactly once at startup and made available to all cores, without
*any* config.
You can also create a lib directory inside the core's instanceDir, which
is also automatically loaded by Solr without config, but this presents a
bit of a catch-22 problem where you can't create the lib directory until
the core exists, but can't get the core to work properly until the lib
directory exists.
There is a feature in SolrCloud for loading jars from a distributed
collection. It doesn't work everywhere in Solr, but classes specified
in solrconfig.xml, for things like request handlers, should work.
https://cwiki.apache.org/confluence/display/solr/Blob+Store+API
There is an enhancement request filed to allow the schema to use jars
from the blob store, but it hasn't received much attention yet:
https://issues.apache.org/jira/browse/SOLR-9175
Thanks,
Shawn