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 Lawson <bw...@gmail.com> on 2016/01/21 19:13:47 UTC
sharedLib node in solr.xml
I am working with the gettingstarted example from the Solr Quick Start
guide. I developed a couple of Solr plugins and I want to tell Solr where
to find them, and I'm following this
<https://wiki.apache.org/solr/SolrPlugins> guide to do it. For a single
core it was easy, I just put them in a lib directory under the instance
directory. But now I am trying it with multiple cores. In
/solr-5.4.0/server/solr, I updated the solr.xml file with sharedLib as
follows:
<solr>
<solrcloud>
* <str name="sharedLib">${sharedLib:}</str>*
<str name="host">${host:}</str>
<int name="hostPort">${jetty.port:8983}</int>
<str name="hostContext">${hostContext:solr}</str>
<bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
<int name="zkClientTimeout">${zkClientTimeout:30000}</int>
<int
name="distribUpdateSoTimeout">${distribUpdateSoTimeout:600000}</int>
<int
name="distribUpdateConnTimeout">${distribUpdateConnTimeout:60000}</int>
</solrcloud>
<shardHandlerFactory name="shardHandlerFactory"
class="HttpShardHandlerFactory">
<int name="socketTimeout">${socketTimeout:600000}</int>
<int name="connTimeout">${connTimeout:60000}</int>
</shardHandlerFactory>
</solr>
But when I start up Solr, the log says: Unknown configuration parameter in
<solrcloud> section of solr.xml: sharedLib
Then I read that I need a core.properties file to contain the sharedLib
variable. If this is true, where should I place this file? Where should I
place my shared library containing my plugins? One other question: in the
gettingstarted example, what directory is the instance directory?
Thanks for the help.
Re: sharedLib node in solr.xml
Posted by Bob Lawson <bw...@gmail.com>.
Shawn, that was it! I copied my lib directory to both
/solr-5.4.0/example/cloud/node1/solr and
/solr-5.4.0/example/cloud/node2/solr. Everything ran perfectly.
Maybe the documentation should be updated with this clarification, because
it currently makes it sound like all you have to do is put lib into
/solr-5.4.0/server/solr
Thank you so much for your help! You guys are great and provide a
wonderful service to us novices.
On Thu, Jan 21, 2016 at 4:54 PM, Shawn Heisey <el...@elyograg.org> wrote:
> On 1/21/2016 1:56 PM, Bob Lawson wrote:
>
>> I then copied the exact same solrconfig.xml file to
>> /solr-5.4.0/server/solr/configsets/data_driven_schema_configs/conf. I
>> copied the exact same lib directory to /solr-5.4.0/server/solr. I tried
>> to
>> launch the cloud gettingstarted example by executing: bin/solr start -e
>> cloud -noprompt. I received the following error:
>>
>
> When you start Solr with "bin/solr start" the solr home is not explicitly
> set, so it becomes "./solr" -- with "server" as the current working
> directory.
>
> When you start with -e cloud, you're potentially running more than one
> Solr instance. Each one has a specific solr home under the example
> directory. You would need to copy the lib directory into each of those
> solr home directories in order for this to work.
>
> Thanks,
> Shawn
>
>
Re: sharedLib node in solr.xml
Posted by Shawn Heisey <el...@elyograg.org>.
On 1/21/2016 1:56 PM, Bob Lawson wrote:
> I then copied the exact same solrconfig.xml file to
> /solr-5.4.0/server/solr/configsets/data_driven_schema_configs/conf. I
> copied the exact same lib directory to /solr-5.4.0/server/solr. I tried to
> launch the cloud gettingstarted example by executing: bin/solr start -e
> cloud -noprompt. I received the following error:
When you start Solr with "bin/solr start" the solr home is not
explicitly set, so it becomes "./solr" -- with "server" as the current
working directory.
When you start with -e cloud, you're potentially running more than one
Solr instance. Each one has a specific solr home under the example
directory. You would need to copy the lib directory into each of those
solr home directories in order for this to work.
Thanks,
Shawn
Re: sharedLib node in solr.xml
Posted by Bob Lawson <bw...@gmail.com>.
I just wanted to give an update on this problem.
I decided to reinstall Solr 5.4.0 and try again, following the simplest
procedure I could.
First I created a single core collection called 'test'. I modified
solrconfig.xml to use my plugin. I created a lib directory under the test
folder. The lib directory contains the jar with my plugin. I restarted
Solr with bin/solr start, and everything ran perfectly. I then stopped
Solr with bin/solr stop.
I then copied the exact same solrconfig.xml file to
/solr-5.4.0/server/solr/configsets/data_driven_schema_configs/conf. I
copied the exact same lib directory to /solr-5.4.0/server/solr. I tried to
launch the cloud gettingstarted example by executing: bin/solr start -e
cloud -noprompt. I received the following error:
*ERROR: Failed to create collection 'gettingstarted' due to:
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error
from server at http://10.0.2.15:7574/solr <http://10.0.2.15:7574/solr>:
Error CREATEing SolrCore 'gettingstarted_shard2_replica2': Unable to create
core [gettingstarted_shard2_replica2] Caused by:
com.rwl.querygen.plugin.MyQueryComponent*
The log file error was:
*ERROR - 2016-01-21 20:46:36.498; [c:gettingstarted s:shard2 r:core_node2
x:gettingstarted_shard2_replica1] org.apache.solr.core.CoreContainer; Error
creating core [gettingstarted_shard2_replica1]: Error loading class
'com.rwl.querygen.plugin.MyQueryComponent'*
It certainly looks like Solr is looking somewhere else for my jar file, but
I followed the guide and advice on this thread to the letter. Cleary,
there is nothing wrong with my solrconfig.xml or my lib directory, because
they work fine with the simpler single core instantiation.
Once again, I appreciate those who have taken time to help and appreciate
any continued support I can get. Thanks!!!
On Thu, Jan 21, 2016 at 2:22 PM, Bob Lawson <bw...@gmail.com> wrote:
> Correction:
>
> Thanks. I tried what you said and sill have problems. I removed
> sharedLib from solr.xml, so solr.xml is back to its original state. I then
> placed a lib directory containing my jar into the solr home directory,
> which is /solr-5.4.0/server/solr. I then ran bin/solr start -e cloud
> -noprompt
>
> Received error: Error CREATEing SolrCore
> 'gettingstarted_shard1_replica2': Unable to create core
> [gettingstarted_shard1_replica2] Caused by:
> com.rwl.querygen.plugin.MyQueryComponent
>
> Log said: Error loading class 'com.rwl.querygen.plugin.MyQueryComponent'
>
> Obviously, it can't find the jar containing MyQueryComponent. I know I'm
> doing something wrong, but I'm stuck again. Thanks in advance for any
> further advice.
>
> On Thu, Jan 21, 2016 at 2:21 PM, Bob Lawson <bw...@gmail.com> wrote:
>
>> Thanks. I tried what you said and sill have problems. I removed
>> sharedLib from solr.xml, so solr.xml is back to its original state. I then
>> placed a lib directory containing my jar into the solr home directory,
>> which is /solr-5.4.0/server/solr. I then ran bin/solr start -e cloud
>> -noprompt
>>
>> Received error: Error CREATEing SolrCore
>> 'gettingstarted_shard1_replica2': Unable to create core
>> [gettingstarted_shard1_replica2] Caused by:
>> com.oracle.querygen.plugin.DraQueryComponent
>>
>> Log said: Error loading class 'com.rwl.querygen.plugin.MyQueryComponent'
>>
>> Obviously, it can't find the jar containing MyQueryComponent. I know I'm
>> doing something wrong, but I'm stuck again. Thanks in advance for any
>> further advice.
>>
>> On Thu, Jan 21, 2016 at 2:04 PM, Shawn Heisey <ap...@elyograg.org>
>> wrote:
>>
>>> On 1/21/2016 11:13 AM, Bob Lawson wrote:
>>> > I am working with the gettingstarted example from the Solr Quick Start
>>> > guide. I developed a couple of Solr plugins and I want to tell Solr
>>> where
>>> > to find them, and I'm following this
>>> > <https://wiki.apache.org/solr/SolrPlugins> guide to do it. For a
>>> single
>>> > core it was easy, I just put them in a lib directory under the instance
>>> > directory. But now I am trying it with multiple cores. In
>>> > /solr-5.4.0/server/solr, I updated the solr.xml file with sharedLib as
>>> > follows:
>>> >
>>> > <solr>
>>> >
>>> > <solrcloud>
>>> >
>>> > * <str name="sharedLib">${sharedLib:}</str>*
>>> <snip>
>>> > But when I start up Solr, the log says: Unknown configuration
>>> parameter in
>>> > <solrcloud> section of solr.xml: sharedLib
>>>
>>> The sharedLib parameter is not for SolrCloud, it is for Solr in
>>> general. Put it in the <solr> section, not the <solrcloud> section.
>>>
>>> If you are going to use the default location (which is $SOLRHOME/lib ...
>>> $SOLRHOME is where solr.xml lives), then you do not need to include the
>>> sharedLib configuration at all.
>>>
>>> Thanks,
>>> Shawn
>>>
>>>
>>
>
Re: sharedLib node in solr.xml
Posted by Bob Lawson <bw...@gmail.com>.
Correction:
Thanks. I tried what you said and sill have problems. I removed sharedLib
from solr.xml, so solr.xml is back to its original state. I then placed a
lib directory containing my jar into the solr home directory, which is
/solr-5.4.0/server/solr. I then ran bin/solr start -e cloud -noprompt
Received error: Error CREATEing SolrCore 'gettingstarted_shard1_replica2':
Unable to create core [gettingstarted_shard1_replica2] Caused by:
com.rwl.querygen.plugin.MyQueryComponent
Log said: Error loading class 'com.rwl.querygen.plugin.MyQueryComponent'
Obviously, it can't find the jar containing MyQueryComponent. I know I'm
doing something wrong, but I'm stuck again. Thanks in advance for any
further advice.
On Thu, Jan 21, 2016 at 2:21 PM, Bob Lawson <bw...@gmail.com> wrote:
> Thanks. I tried what you said and sill have problems. I removed
> sharedLib from solr.xml, so solr.xml is back to its original state. I then
> placed a lib directory containing my jar into the solr home directory,
> which is /solr-5.4.0/server/solr. I then ran bin/solr start -e cloud
> -noprompt
>
> Received error: Error CREATEing SolrCore
> 'gettingstarted_shard1_replica2': Unable to create core
> [gettingstarted_shard1_replica2] Caused by:
> com.oracle.querygen.plugin.DraQueryComponent
>
> Log said: Error loading class 'com.rwl.querygen.plugin.MyQueryComponent'
>
> Obviously, it can't find the jar containing MyQueryComponent. I know I'm
> doing something wrong, but I'm stuck again. Thanks in advance for any
> further advice.
>
> On Thu, Jan 21, 2016 at 2:04 PM, Shawn Heisey <ap...@elyograg.org> wrote:
>
>> On 1/21/2016 11:13 AM, Bob Lawson wrote:
>> > I am working with the gettingstarted example from the Solr Quick Start
>> > guide. I developed a couple of Solr plugins and I want to tell Solr
>> where
>> > to find them, and I'm following this
>> > <https://wiki.apache.org/solr/SolrPlugins> guide to do it. For a single
>> > core it was easy, I just put them in a lib directory under the instance
>> > directory. But now I am trying it with multiple cores. In
>> > /solr-5.4.0/server/solr, I updated the solr.xml file with sharedLib as
>> > follows:
>> >
>> > <solr>
>> >
>> > <solrcloud>
>> >
>> > * <str name="sharedLib">${sharedLib:}</str>*
>> <snip>
>> > But when I start up Solr, the log says: Unknown configuration
>> parameter in
>> > <solrcloud> section of solr.xml: sharedLib
>>
>> The sharedLib parameter is not for SolrCloud, it is for Solr in
>> general. Put it in the <solr> section, not the <solrcloud> section.
>>
>> If you are going to use the default location (which is $SOLRHOME/lib ...
>> $SOLRHOME is where solr.xml lives), then you do not need to include the
>> sharedLib configuration at all.
>>
>> Thanks,
>> Shawn
>>
>>
>
Re: sharedLib node in solr.xml
Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/21/2016 12:21 PM, Bob Lawson wrote:
> Thanks. I tried what you said and sill have problems. I removed sharedLib
> from solr.xml, so solr.xml is back to its original state. I then placed a
> lib directory containing my jar into the solr home directory, which is
> /solr-5.4.0/server/solr. I then ran bin/solr start -e cloud -noprompt
>
> Received error: Error CREATEing SolrCore 'gettingstarted_shard1_replica2':
> Unable to create core [gettingstarted_shard1_replica2] Caused by:
> com.oracle.querygen.plugin.DraQueryComponent
>
> Log said: Error loading class 'com.rwl.querygen.plugin.MyQueryComponent'
>
> Obviously, it can't find the jar containing MyQueryComponent. I know I'm
> doing something wrong, but I'm stuck again. Thanks in advance for any
> further advice.
Do you by chance have <lib> elements in your solrconfig.xml that load
this jar? When you use $SOLRHOME/lib, you should *not* use <lib> in
solrconfig.xml. Some jars seem to have problems when they are loaded
more than once. There have been a number of bugs related to this. The
most recent is SOLR-6188. One of the older bugs is SOLR-4852.
Can you delete the solr log, restart Solr, and put the new log somewhere
(like gist, or a paste website) that we can view it? This will include
a lot of information that can help pinpoint what's happening.
Thanks,
Shawn
Re: sharedLib node in solr.xml
Posted by Bob Lawson <bw...@gmail.com>.
Thanks. I tried what you said and sill have problems. I removed sharedLib
from solr.xml, so solr.xml is back to its original state. I then placed a
lib directory containing my jar into the solr home directory, which is
/solr-5.4.0/server/solr. I then ran bin/solr start -e cloud -noprompt
Received error: Error CREATEing SolrCore 'gettingstarted_shard1_replica2':
Unable to create core [gettingstarted_shard1_replica2] Caused by:
com.oracle.querygen.plugin.DraQueryComponent
Log said: Error loading class 'com.rwl.querygen.plugin.MyQueryComponent'
Obviously, it can't find the jar containing MyQueryComponent. I know I'm
doing something wrong, but I'm stuck again. Thanks in advance for any
further advice.
On Thu, Jan 21, 2016 at 2:04 PM, Shawn Heisey <ap...@elyograg.org> wrote:
> On 1/21/2016 11:13 AM, Bob Lawson wrote:
> > I am working with the gettingstarted example from the Solr Quick Start
> > guide. I developed a couple of Solr plugins and I want to tell Solr
> where
> > to find them, and I'm following this
> > <https://wiki.apache.org/solr/SolrPlugins> guide to do it. For a single
> > core it was easy, I just put them in a lib directory under the instance
> > directory. But now I am trying it with multiple cores. In
> > /solr-5.4.0/server/solr, I updated the solr.xml file with sharedLib as
> > follows:
> >
> > <solr>
> >
> > <solrcloud>
> >
> > * <str name="sharedLib">${sharedLib:}</str>*
> <snip>
> > But when I start up Solr, the log says: Unknown configuration parameter
> in
> > <solrcloud> section of solr.xml: sharedLib
>
> The sharedLib parameter is not for SolrCloud, it is for Solr in
> general. Put it in the <solr> section, not the <solrcloud> section.
>
> If you are going to use the default location (which is $SOLRHOME/lib ...
> $SOLRHOME is where solr.xml lives), then you do not need to include the
> sharedLib configuration at all.
>
> Thanks,
> Shawn
>
>
Re: sharedLib node in solr.xml
Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/21/2016 11:13 AM, Bob Lawson wrote:
> I am working with the gettingstarted example from the Solr Quick Start
> guide. I developed a couple of Solr plugins and I want to tell Solr where
> to find them, and I'm following this
> <https://wiki.apache.org/solr/SolrPlugins> guide to do it. For a single
> core it was easy, I just put them in a lib directory under the instance
> directory. But now I am trying it with multiple cores. In
> /solr-5.4.0/server/solr, I updated the solr.xml file with sharedLib as
> follows:
>
> <solr>
>
> <solrcloud>
>
> * <str name="sharedLib">${sharedLib:}</str>*
<snip>
> But when I start up Solr, the log says: Unknown configuration parameter in
> <solrcloud> section of solr.xml: sharedLib
The sharedLib parameter is not for SolrCloud, it is for Solr in
general. Put it in the <solr> section, not the <solrcloud> section.
If you are going to use the default location (which is $SOLRHOME/lib ...
$SOLRHOME is where solr.xml lives), then you do not need to include the
sharedLib configuration at all.
Thanks,
Shawn