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 J G <sk...@hotmail.com> on 2009/07/11 05:26:34 UTC

solr jmx connection

 Hello,

I have a SOLR JMX connection issue. I am running my JMX MBeanServer through Tomcat, meaning I am using Tomcat's MBeanServer rather than any other MBeanServer implemenation.
I am having a hard time trying to figure out the correct JMX Service URL on my localhost for the accessing the SOLR MBeans. My current configuration consists of the following:

JMX Service url = localhost:9000/jmxrmi

So I have configured JMX to run on port 9000 on tomcat on my localhost and using the above service url i can access the tomcat jmx MBeanServer and get related JVM object information(e.g. I can access the MemoryMXBean object)

However, I am having a harder time trying to access the SOLR MBeans. First, I could have the wrong service URL. Second, I'm confused as to which MBeans SOLR provides.

You might be asking why am I creating my own client rather than using JConsole, but JConsole doesn't provide the features I need.

Anyone with any knowledge or code snippets would be a huge help!

Thank you for your time!

Regards



_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits. 
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

Re: solr jmx connection

Posted by Chris Hostetter <ho...@fucit.org>.
: > However, I am having a harder time trying to access the SOLR MBeans. First,
: > I could have the wrong service URL. Second, I'm confused as to which MBeans
: > SOLR provides.
: >
: >: The service url is of the form --
: "service:jmx:rmi:///jndi/rmi://localhost:9999/solr". The following code
: snippet is taked from TestJmxMonitoredMap unit test:
: 
:         String url = "service:jmx:rmi:///jndi/rmi://localhost:9999/solr";
:         JMXServiceURL u = new JMXServiceURL(url);
:         connector = JMXConnectorFactory.connect(u);
:         mbeanServer = connector.getMBeanServerConnection();

That's the URL that the tests use, because it's connecting over RMI, to a 
local server, which was instantiated by solr...

if you are connecting from a remote App, it might be slightly different;
if you configure solr to register the MBeans an existing JMX MBeanServer 
(like the one created by TomCat) then it will different.

The wiki (and the example solrconfig.xml) have all the details...
    http://wiki.apache.org/solr/SolrJmx
...my advice would be to use jconsole to ensure that your JMX 
configuration for tomcat and solr is doing what you want *then* use 
whatever URL winds up working for jconsole to connect from your custom app




-Hoss


Re: solr jmx connection

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sat, Jul 11, 2009 at 8:56 AM, J G <sk...@hotmail.com> wrote:

>
> I have a SOLR JMX connection issue. I am running my JMX MBeanServer through
> Tomcat, meaning I am using Tomcat's MBeanServer rather than any other
> MBeanServer implemenation.
> I am having a hard time trying to figure out the correct JMX Service URL on
> my localhost for the accessing the SOLR MBeans. My current configuration
> consists of the following:
>
> JMX Service url = localhost:9000/jmxrmi
>
> So I have configured JMX to run on port 9000 on tomcat on my localhost and
> using the above service url i can access the tomcat jmx MBeanServer and get
> related JVM object information(e.g. I can access the MemoryMXBean object)
>
> However, I am having a harder time trying to access the SOLR MBeans. First,
> I could have the wrong service URL. Second, I'm confused as to which MBeans
> SOLR provides.
>
>
The service url is of the form --
"service:jmx:rmi:///jndi/rmi://localhost:9999/solr". The following code
snippet is taked from TestJmxMonitoredMap unit test:

        String url = "service:jmx:rmi:///jndi/rmi://localhost:9999/solr";
        JMXServiceURL u = new JMXServiceURL(url);
        connector = JMXConnectorFactory.connect(u);
        mbeanServer = connector.getMBeanServerConnection();

Solr exposes many MBeans, there's one named "searcher" which always refers
to the live SolrIndexSearcher. You can connect with jconsole once to see all
the mbeans.

Hope that helps.

-- 
Regards,
Shalin Shekhar Mangar.