Solr
  1. Solr
  2. SOLR-1843

JMX name collision when running multiple SOLR instances/webapps in the same ServletContainer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4, 3.5
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: Build
    • Labels:
    • Environment:

      Resin 3.1.6, possibly other application containers

      Description

      http://www.mail-archive.com/solr-user@lucene.apache.org/msg33921.html

      When i run multiple independent SOLR webapps both with JMX enabled there seems to be some sort of collision when registering Mbeans causing my application server to throw exceptions for each mbean it tries to register for all applications after the first.

      This seems to be due to collision issue of sorts with both applications trying to register their mbeans under the name "solr"

      This patch fixes the issue by allowing the user to specify the name under which MBeans are registered in solrconfig.xml like so:
      <jmx rootName="mySolr" />

      i went with rootName since in the code the variable is called jmxRootName.

      Constantijn Visinescu

      1. JmxMonitoredMap.java
        10 kB
        Constantijn Visinescu
      2. SolrConfig.java
        18 kB
        Constantijn Visinescu

        Activity

        Hide
        Constantijn Visinescu added a comment - - edited

        Attached files are based on revision 829938 : Starting Solr 1.4 branch.

        Show
        Constantijn Visinescu added a comment - - edited Attached files are based on revision 829938 : Starting Solr 1.4 branch.
        Hide
        Hoss Man added a comment -

        Committed revision 942292.

        Constantijn: thanks for this suggestion. The one significant change i made from your original files (BTW: a patch would have been much easier to review) is that i made the "rootName" option completely replace the previous default: "solr/" + coreName (as opposed to your version where only the "solr" literal was was replaced by the rootName)

        Since this lives in solrconfig.xml it's a core specific setting, and core properties can be used to include the coreName in the rootName if that's what people desire

        Show
        Hoss Man added a comment - Committed revision 942292. Constantijn: thanks for this suggestion. The one significant change i made from your original files (BTW: a patch would have been much easier to review) is that i made the "rootName" option completely replace the previous default: "solr/" + coreName (as opposed to your version where only the "solr" literal was was replaced by the rootName) Since this lives in solrconfig.xml it's a core specific setting, and core properties can be used to include the coreName in the rootName if that's what people desire
        Hide
        Hoss Man added a comment -

        Correcting Fix Version based on CHANGES.txt, see this thread for more details...

        http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

        Show
        Hoss Man added a comment - Correcting Fix Version based on CHANGES.txt, see this thread for more details... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E
        Hide
        Hoss Man added a comment -

        re-opening as a reminder to myself to try and backport

        Show
        Hoss Man added a comment - re-opening as a reminder to myself to try and backport
        Hide
        Hoss Man added a comment -

        backported to 3x - r1227440

        Show
        Hoss Man added a comment - backported to 3x - r1227440

          People

          • Assignee:
            Hoss Man
            Reporter:
            Constantijn Visinescu
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development