Solr
  1. Solr
  2. SOLR-6726

Specifying different ports with the new bin/solr script fails to start solr instances

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.10.3, 5.0
    • Component/s: None
    • Labels:
      None

      Description

      As I recall, I tried to specify different ports when bringing up 4 instances (7200, 7300, 7400) and the startup script failed. I'll confirm this and maybe propose a fix if I can reproduce. Assigning it to me so I make sure it's checked.

      I'm at Lucene Revolution this week, so if anyone wants to pick this up feel free.

        Issue Links

          Activity

          Hide
          Erick Erickson added a comment -

          Poking around a little more, mostly hacking around since I don't really know what's going on,
          it's bash scripting and I'm sitting in an airport....:

          1> At first I wondered if it was a problem with just reading in the port, but if I
          hack bin/solr and change this line
          declare -a CLOUD_PORTS=('8983' '7574' '8984' '7575');
          to this line
          declare -a CLOUD_PORTS=('8983' '7200' '7300' '7400');
          the same thing occurs.
          2> using this command: ./solr start -c -e cloud -z localhost:2181
          3> If I change as above and put in the original ports, it's fine. (i.e., I get prompted for node2 to go on 7200
          and enter 7574 instead.
          4> node2/logs/solr-7200-console.log consists of: "Error: Exception thrown by the agent : java.lang.NullPointerException"

          bonus question: Why is there a log for 8983 in node2 (which is where the 7200 core is supposed to be) and why does it contain the line:
          org.apache.solr.core.CoresLocator – Looking for core definitions underneath /Users/Erick/apache/trunk_6703/solr/server/solr?

          Show
          Erick Erickson added a comment - Poking around a little more, mostly hacking around since I don't really know what's going on, it's bash scripting and I'm sitting in an airport....: 1> At first I wondered if it was a problem with just reading in the port, but if I hack bin/solr and change this line declare -a CLOUD_PORTS=('8983' '7574' '8984' '7575'); to this line declare -a CLOUD_PORTS=('8983' '7200' '7300' '7400'); the same thing occurs. 2> using this command: ./solr start -c -e cloud -z localhost:2181 3> If I change as above and put in the original ports, it's fine. (i.e., I get prompted for node2 to go on 7200 and enter 7574 instead. 4> node2/logs/solr-7200-console.log consists of: "Error: Exception thrown by the agent : java.lang.NullPointerException" bonus question: Why is there a log for 8983 in node2 (which is where the 7200 core is supposed to be) and why does it contain the line: org.apache.solr.core.CoresLocator – Looking for core definitions underneath /Users/Erick/apache/trunk_6703/solr/server/solr?
          Hide
          Erick Erickson added a comment -

          OK, apparently I'm getting a port conflict.

          For port 8983, the startup up needs
          8983 for Solr
          1083 for jmx
          7983 for the stop port.

          So, specifying 7200, 7300 and 7400 is a problem since they all map to 1000 for jmx.

          I guess all we really should be doing here is documenting the ports used by each Solr instance.

          Show
          Erick Erickson added a comment - OK, apparently I'm getting a port conflict. For port 8983, the startup up needs 8983 for Solr 1083 for jmx 7983 for the stop port. So, specifying 7200, 7300 and 7400 is a problem since they all map to 1000 for jmx. I guess all we really should be doing here is documenting the ports used by each Solr instance.
          Hide
          Chaiyasit (Sit) Manovit added a comment -

          There seem to be two issues here:

          1. 7200, 7300 and 7400 have same 2-digit suffix and thus they all map to 1000 for jmx.

          2. 1000 is an OS privileged port and requires root permission.

          For the second issue, I have filed SOLR-6791.

          Thanks.

          Show
          Chaiyasit (Sit) Manovit added a comment - There seem to be two issues here: 1. 7200, 7300 and 7400 have same 2-digit suffix and thus they all map to 1000 for jmx. 2. 1000 is an OS privileged port and requires root permission. For the second issue, I have filed SOLR-6791 . Thanks.
          Hide
          Erick Erickson added a comment -

          This particular issue (as different from Chaiyasit's) can be resolved by using different ports. We still should document the ports used and not force users to dig around the script though.

          I can do what I want here by using ports 8981, 8982, 8983, 8984. I just find that easier when pinging individual nodes than remembering 7574 is the second node started or whatever.

          Show
          Erick Erickson added a comment - This particular issue (as different from Chaiyasit's) can be resolved by using different ports. We still should document the ports used and not force users to dig around the script though. I can do what I want here by using ports 8981, 8982, 8983, 8984. I just find that easier when pinging individual nodes than remembering 7574 is the second node started or whatever.
          Hide
          Timothy Potter added a comment -

          I'd like to get this and SOLR-6791 into the 4.10.3 release ... do you want me to fix this up Erick? Needs to be done for Windows too.

          Show
          Timothy Potter added a comment - I'd like to get this and SOLR-6791 into the 4.10.3 release ... do you want me to fix this up Erick? Needs to be done for Windows too.
          Hide
          Erick Erickson added a comment - - edited

          Timothy Potter Please do. I don't have any strong opinions about whether this is just documentation or not.

          My particular use-case is solved by specifying ports 8981-8984 FWIW. And I always run as admin so SOLR-6791 isn't really an issue for me so whatever you think best.

          Hmmm, P.S. What would help most might be to echo what ports are being used as part of the script rather than make users look through documentation. Or even just have the help screen for the -p option indicate how the other ports are being assigned.

          Show
          Erick Erickson added a comment - - edited Timothy Potter Please do. I don't have any strong opinions about whether this is just documentation or not. My particular use-case is solved by specifying ports 8981-8984 FWIW. And I always run as admin so SOLR-6791 isn't really an issue for me so whatever you think best. Hmmm, P.S. What would help most might be to echo what ports are being used as part of the script rather than make users look through documentation. Or even just have the help screen for the -p option indicate how the other ports are being assigned.
          Hide
          ASF subversion and git services added a comment -

          Commit 1642745 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1642745 ]

          SOLR-6726: better strategy for selecting the JMX RMI port based on SOLR_PORT in bin/solr

          Show
          ASF subversion and git services added a comment - Commit 1642745 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1642745 ] SOLR-6726 : better strategy for selecting the JMX RMI port based on SOLR_PORT in bin/solr
          Hide
          ASF subversion and git services added a comment -

          Commit 1642747 from Timothy Potter in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1642747 ]

          SOLR-6726: better strategy for selecting the JMX RMI port based on SOLR_PORT in bin/solr

          Show
          ASF subversion and git services added a comment - Commit 1642747 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1642747 ] SOLR-6726 : better strategy for selecting the JMX RMI port based on SOLR_PORT in bin/solr
          Hide
          ASF subversion and git services added a comment -

          Commit 1642749 from Timothy Potter in branch 'dev/branches/lucene_solr_4_10'
          [ https://svn.apache.org/r1642749 ]

          SOLR-6726: better strategy for selecting the JMX RMI port based on SOLR_PORT in bin/solr

          Show
          ASF subversion and git services added a comment - Commit 1642749 from Timothy Potter in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1642749 ] SOLR-6726 : better strategy for selecting the JMX RMI port based on SOLR_PORT in bin/solr
          Hide
          Timothy Potter added a comment -

          So now the script uses 1$SOLR_PORT for the JMX RMI port (18983 if using the default 8983) but you can also just set the RMI port in solr.in.sh (.cmd). I'm sure you can still break things if you do: -p 2022 as the stop port will be computed to 1022, which is not allowed unless Solr is launched by root. I also added some more help information about port assignments used by the script.

          Show
          Timothy Potter added a comment - So now the script uses 1$SOLR_PORT for the JMX RMI port (18983 if using the default 8983) but you can also just set the RMI port in solr.in.sh (.cmd). I'm sure you can still break things if you do: -p 2022 as the stop port will be computed to 1022, which is not allowed unless Solr is launched by root. I also added some more help information about port assignments used by the script.
          Hide
          Anshum Gupta added a comment -

          Bulk close after 5.0 release.

          Show
          Anshum Gupta added a comment - Bulk close after 5.0 release.

            People

            • Assignee:
              Timothy Potter
              Reporter:
              Erick Erickson
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development