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 Constantijn Visinescu <ba...@gmail.com> on 2010/03/23 11:10:23 UTC

Configuring multiple SOLR apps to play nice with MBeans / JMX

Hi,

I'm having a problem trying to get multiple solr applications to run in the
same servlet container because they all try to claim "solr" as a
name/category to put their mbeans under and that causes exceptions/crashes
for all the applications after the first.

I've read http://wiki.apache.org/solr/SolrJmx and it shows configuration
options to define a JMX server agentID or to provide your own JMX url but i
don't want either. (i think)

I just want my webapps to show as "solr1", "solr2" and "solr3" when
monitoring them rather then all of them trying to race for "solr" and having
all of them after the first crash.

Right now I've disabled JMX and that works to get my apps started at least,
but it's not what i want either.

Anyone know how to configure solr to do this?
If a configuration option like <jmx name="solr1" /> exists that'd fix my
problem but i can't seem to find it in the documentation.

Thanks in advance,
Constantijn Visinescu

Re: Configuring multiple SOLR apps to play nice with MBeans / JMX

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Wow, this sounds interesting.  I never looked at JMX with multiple cores Solr instances.
I wonder if this calls for a new JIRA issue....

Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Hadoop ecosystem search :: http://search-hadoop.com/



----- Original Message ----
> From: Constantijn Visinescu <ba...@gmail.com>
> To: solr-user@lucene.apache.org
> Sent: Tue, March 23, 2010 8:42:30 AM
> Subject: Re: Configuring multiple SOLR apps to play nice with MBeans / JMX
> 
> Hi,

Multicore lets me have me have multiple cores in a single 
> instance.

However since i have 3 different webapps with embedded solr 
> that means i
have 3 different instances of solr.
(and they're all trying 
> to park their JMX MBeans under the same name, 
> namely
solr)

Constantijn


On Tue, Mar 23, 2010 at 11:44 AM, 
> Charl Mert <
> href="mailto:charl@knowledgetree.com">charl@knowledgetree.com>wrote:

> 
> Hi Constantijn,
>
> I'm not too sure about the JMX monitoring side 
> of things but having looked
> at the Solr's MultiCore <
> href="http://wiki.apache.org/solr/CoreAdmin" target=_blank 
> >http://wiki.apache.org/solr/CoreAdmin>
> feature it seems really 
> simple to create multiple solr cores that could all
> be configured to 
> point
> to one MBean server.
>
> When creating a core you can 
> specify name like solr1, solr2:
>
> 
> href="http://localhost:8983/solr/admin/cores?action=CREATE&name=solr_01&instanceDir=/etc/solr/multicore/core2&config=solrconfig.xml&schema=schema.xml&dataDir=data" 
> target=_blank 
> >http://localhost:8983/solr/admin/cores?action=CREATE&name=solr_01&instanceDir=/etc/solr/multicore/core2&config=solrconfig.xml&schema=schema.xml&dataDir=data
>
> 
> This is made possible due to the fact that each core can have it's own
> 
> solrconfig.xml
> See example/multicore/ in your solr 
> distribution.
>
> Hope this helps.
>
> Regards
> 
> Charl Mert
>
>
>
> On Tue, Mar 23, 2010 at 12:10 PM, 
> Constantijn Visinescu
> <
> href="mailto:baelin82@gmail.com">baelin82@gmail.com>wrote:
>
> 
> > Hi,
> >
> > I'm having a problem trying to get multiple 
> solr applications to run in
> the
> > same servlet container 
> because they all try to claim "solr" as a
> > name/category to put 
> their mbeans under and that causes
> exceptions/crashes
> > for 
> all the applications after the first.
> >
> > I've read 
> href="http://wiki.apache.org/solr/SolrJmx" target=_blank 
> >http://wiki.apache.org/solr/SolrJmx and it shows configuration
> > 
> options to define a JMX server agentID or to provide your own JMX url 
> but
> i
> > don't want either. (i think)
> >
> 
> > I just want my webapps to show as "solr1", "solr2" and "solr3" when
> 
> > monitoring them rather then all of them trying to race for "solr" 
> and
> > having
> > all of them after the first crash.
> 
> >
> > Right now I've disabled JMX and that works to get my apps 
> started at
> least,
> > but it's not what i want either.
> 
> >
> > Anyone know how to configure solr to do this?
> > If 
> a configuration option like <jmx name="solr1" /> exists that'd fix 
> my
> > problem but i can't seem to find it in the 
> documentation.
> >
> > Thanks in advance,
> > 
> Constantijn Visinescu
> >
>

Re: Configuring multiple SOLR apps to play nice with MBeans / JMX

Posted by Constantijn Visinescu <ba...@gmail.com>.
Hi,

Multicore lets me have me have multiple cores in a single instance.

However since i have 3 different webapps with embedded solr that means i
have 3 different instances of solr.
(and they're all trying to park their JMX MBeans under the same name, namely
solr)

Constantijn


On Tue, Mar 23, 2010 at 11:44 AM, Charl Mert <ch...@knowledgetree.com>wrote:

> Hi Constantijn,
>
> I'm not too sure about the JMX monitoring side of things but having looked
> at the Solr's MultiCore <http://wiki.apache.org/solr/CoreAdmin>
> feature it seems really simple to create multiple solr cores that could all
> be configured to point
> to one MBean server.
>
> When creating a core you can specify name like solr1, solr2:
>
> http://localhost:8983/solr/admin/cores?action=CREATE&name=solr_01&instanceDir=/etc/solr/multicore/core2&config=solrconfig.xml&schema=schema.xml&dataDir=data
>
> This is made possible due to the fact that each core can have it's own
> solrconfig.xml
> See example/multicore/ in your solr distribution.
>
> Hope this helps.
>
> Regards
> Charl Mert
>
>
>
> On Tue, Mar 23, 2010 at 12:10 PM, Constantijn Visinescu
> <ba...@gmail.com>wrote:
>
> > Hi,
> >
> > I'm having a problem trying to get multiple solr applications to run in
> the
> > same servlet container because they all try to claim "solr" as a
> > name/category to put their mbeans under and that causes
> exceptions/crashes
> > for all the applications after the first.
> >
> > I've read http://wiki.apache.org/solr/SolrJmx and it shows configuration
> > options to define a JMX server agentID or to provide your own JMX url but
> i
> > don't want either. (i think)
> >
> > I just want my webapps to show as "solr1", "solr2" and "solr3" when
> > monitoring them rather then all of them trying to race for "solr" and
> > having
> > all of them after the first crash.
> >
> > Right now I've disabled JMX and that works to get my apps started at
> least,
> > but it's not what i want either.
> >
> > Anyone know how to configure solr to do this?
> > If a configuration option like <jmx name="solr1" /> exists that'd fix my
> > problem but i can't seem to find it in the documentation.
> >
> > Thanks in advance,
> > Constantijn Visinescu
> >
>

Re: Configuring multiple SOLR apps to play nice with MBeans / JMX

Posted by Charl Mert <ch...@knowledgetree.com>.
Hi Constantijn,

I'm not too sure about the JMX monitoring side of things but having looked
at the Solr's MultiCore <http://wiki.apache.org/solr/CoreAdmin>
feature it seems really simple to create multiple solr cores that could all
be configured to point
to one MBean server.

When creating a core you can specify name like solr1, solr2:
http://localhost:8983/solr/admin/cores?action=CREATE&name=solr_01&instanceDir=/etc/solr/multicore/core2&config=solrconfig.xml&schema=schema.xml&dataDir=data

This is made possible due to the fact that each core can have it's own
solrconfig.xml
See example/multicore/ in your solr distribution.

Hope this helps.

Regards
Charl Mert



On Tue, Mar 23, 2010 at 12:10 PM, Constantijn Visinescu
<ba...@gmail.com>wrote:

> Hi,
>
> I'm having a problem trying to get multiple solr applications to run in the
> same servlet container because they all try to claim "solr" as a
> name/category to put their mbeans under and that causes exceptions/crashes
> for all the applications after the first.
>
> I've read http://wiki.apache.org/solr/SolrJmx and it shows configuration
> options to define a JMX server agentID or to provide your own JMX url but i
> don't want either. (i think)
>
> I just want my webapps to show as "solr1", "solr2" and "solr3" when
> monitoring them rather then all of them trying to race for "solr" and
> having
> all of them after the first crash.
>
> Right now I've disabled JMX and that works to get my apps started at least,
> but it's not what i want either.
>
> Anyone know how to configure solr to do this?
> If a configuration option like <jmx name="solr1" /> exists that'd fix my
> problem but i can't seem to find it in the documentation.
>
> Thanks in advance,
> Constantijn Visinescu
>

Re: Configuring multiple SOLR apps to play nice with MBeans / JMX

Posted by Constantijn Visinescu <ba...@gmail.com>.
Don't know about other servlet containers, but i can confirm Resin 3 breaks
if you try to load 2 completely independent webapps into it that both use
solr with jmx enabled.

I also had a similar issue with Blaze DS (library for flash remoting that
I'm using to power the UI for my webapp), but Blaze DS uses the display-name
from the web.xml to register MBeans under. So making sure each webapp had a
different display name fixed that issue.

However solr always insists in using "solr" regardless of ... well pretty
much everything ;)

here's a part of the stack trace for informational purposes:

13:23:19,572  WARN JmxMonitoredMap:139 - Failed to register info bean:
org.apache.solr.highlight.HtmlFormatter
javax.management.InstanceNotFoundException:
solr:type=org.apache.solr.highlight.HtmlFormatter,id=org.apache.solr.highlight.HtmlFormatter
        at
com.caucho.jmx.MBeanContext.unregisterMBean(MBeanContext.java:285)
        at
com.caucho.jmx.AbstractMBeanServer.unregisterMBean(AbstractMBeanServer.java:477)
        at
org.apache.solr.core.JmxMonitoredMap.put(JmxMonitoredMap.java:135)
        at org.apache.solr.core.JmxMonitoredMap.put(JmxMonitoredMap.java:47)
        at
org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:508)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:605)
        at
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
        at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
        at
com.caucho.server.dispatch.FilterManager.createFilter(FilterManager.java:144)
        at
com.caucho.server.dispatch.FilterManager.init(FilterManager.java:91)
        at com.caucho.server.webapp.WebApp.start(WebApp.java:1871)

note1:
I get a bunch of these, one for every mbean

note2:
I did notice the javax.management.InstanceNotFoundException that suggests it
means the mentioned Mbean doesn't exist. However if i enable jmx for any one
of my applications everything works. However if i enable it for more then
one then one webapp it starts giving these errors for every webapp after the
first that gets loaded. That and my experiences with fixing this same error
under Blaze DS suggests to me a very high likelyhood of some sort of name
collision going on.

Constantijn


On Tue, Mar 23, 2010 at 11:23 PM, Chris Hostetter
<ho...@fucit.org>wrote:

>
> : I'm having a problem trying to get multiple solr applications to run in
> the
> : same servlet container because they all try to claim "solr" as a
>
> Hmmm... i think you're in new territory here.   I don't know that anyone
> has ever mentioned doing this before.
>
> Honestly: I thought the hierarchical nature of JMX would mean that
> the Servlet Container would start up a JMX server, and present a seperate
> "branch" to each webapp in isolation -- based on what you're saying it
> sounds like different webapps can't actually break eachother by mucking
> with JMX Beans/values.
>
> : If a configuration option like <jmx name="solr1" /> exists that'd fix my
> : problem but i can't seem to find it in the documentation.
>
> It doesn't, but it would probably be pretty trivial to add if you want to
> take a stab at a patch for it.
>
>
> -Hoss
>
>

Re: Configuring multiple SOLR apps to play nice with MBeans / JMX

Posted by Constantijn Visinescu <ba...@gmail.com>.
> it would probably be pretty trivial to add if you want to take a stab at a
patch for it.
> -Hoss

*stab*
https://issues.apache.org/jira/browse/SOLR-1843
:)

Re: Configuring multiple SOLR apps to play nice with MBeans / JMX

Posted by Chris Hostetter <ho...@fucit.org>.
: I'm having a problem trying to get multiple solr applications to run in the
: same servlet container because they all try to claim "solr" as a

Hmmm... i think you're in new territory here.   I don't know that anyone 
has ever mentioned doing this before.

Honestly: I thought the hierarchical nature of JMX would mean that 
the Servlet Container would start up a JMX server, and present a seperate 
"branch" to each webapp in isolation -- based on what you're saying it 
sounds like different webapps can't actually break eachother by mucking 
with JMX Beans/values.

: If a configuration option like <jmx name="solr1" /> exists that'd fix my
: problem but i can't seem to find it in the documentation.

It doesn't, but it would probably be pretty trivial to add if you want to 
take a stab at a patch for it.


-Hoss