Solr
  1. Solr
  2. SOLR-7195

bin/solr script thinks port 8983 is in use, when in fact it is 18983 that is in use

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.1
    • Component/s: SolrCloud
    • Labels:
      None
    • Environment:

      Linux bigindy5 3.10.0-123.9.2.el7.x86_64 #1 SMP Tue Oct 28 18:05:26 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

      Description

      I'm trying to start solr instance using the bin/solr script, but it is saying that port 8983 is in use. It's not in use ... but I am using 18983 for the JMX port on another copy of Solr (listen port is 8982), and this is what is being detected.

      [solr@bigindy5 solr]$ lsof -i -Pn | grep 8983
      java 21609 solr 12u IPv6 11401290 0t0 TCP *:18983 (LISTEN)

      1. SOLR-7195.patch
        4 kB
        Shawn Heisey
      2. SOLR-7195.patch
        1 kB
        Shawn Heisey
      3. SOLR-7195.patch
        0.7 kB
        Shawn Heisey
      4. SOLR-7195.patch
        0.5 kB
        Xu Zhang

        Activity

        Hide
        Shawn Heisey added a comment -

        It'll be a little while before I can investigate further. If anyone else wants to take this issue, feel free.

        Show
        Shawn Heisey added a comment - It'll be a little while before I can investigate further. If anyone else wants to take this issue, feel free.
        Hide
        Xu Zhang added a comment -

        This is a quick and dirty fix. The problem happens when doing grep for the port number. It will falsely match 18983 when looking for 8983.

        Show
        Xu Zhang added a comment - This is a quick and dirty fix. The problem happens when doing grep for the port number. It will falsely match 18983 when looking for 8983.
        Hide
        Shawn Heisey added a comment -

        Slight modification to your patch, Xu Zhang.

        As it was written, it would have failed if the user requested port 1088 and 10880 was specified in a "-Dxxx.port=10880" parameter. The regex now looks for whitespace after the number. A quick test seemed to work, but I will need to do some more extensive testing.

        Show
        Shawn Heisey added a comment - Slight modification to your patch, Xu Zhang . As it was written, it would have failed if the user requested port 1088 and 10880 was specified in a "-Dxxx.port=10880" parameter. The regex now looks for whitespace after the number. A quick test seemed to work, but I will need to do some more extensive testing.
        Hide
        Shawn Heisey added a comment -

        Is this sort of syntax allowed in regex? I will try it when I have a little more time.

        "port=$SOLR_PORT(\s|$)"
        
        Show
        Shawn Heisey added a comment - Is this sort of syntax allowed in regex? I will try it when I have a little more time. "port=$SOLR_PORT(\s|$)"
        Hide
        simpleBread added a comment -

        Ha, right. Or we can just use "grep -w $SOLR_PORT"

        Show
        simpleBread added a comment - Ha, right. Or we can just use "grep -w $SOLR_PORT"
        Hide
        Xu Zhang added a comment -

        We can just use "grep -w $SOLR_PORT"

        Show
        Xu Zhang added a comment - We can just use "grep -w $SOLR_PORT"
        Hide
        Shawn Heisey added a comment -

        I think -w will work. It's not a feature limited to gnu grep. I looked at the man page on Solaris, and it is supported. Google says it's supported on OpenBSD, so it's probably also supported on all the other BSD variants.

        I would be interested in knowing whether there are any *nix systems where -w is not supported on the native grep, and how common those systems are.

        Show
        Shawn Heisey added a comment - I think -w will work. It's not a feature limited to gnu grep. I looked at the man page on Solaris, and it is supported. Google says it's supported on OpenBSD, so it's probably also supported on all the other BSD variants. I would be interested in knowing whether there are any *nix systems where -w is not supported on the native grep, and how common those systems are.
        Hide
        Shawn Heisey added a comment -

        Latest patch against trunk with CHANGES.txt addition. If there are no objections, I will commit this and backport to branch_5x.

        Show
        Shawn Heisey added a comment - Latest patch against trunk with CHANGES.txt addition. If there are no objections, I will commit this and backport to branch_5x.
        Hide
        Shawn Heisey added a comment -

        New patch. I noticed that all grep commands looking for "start.jar" did not escape the dot character. This was probably NOT a big deal, but I think the goal is completely correct code.

        Show
        Shawn Heisey added a comment - New patch. I noticed that all grep commands looking for "start.jar" did not escape the dot character. This was probably NOT a big deal, but I think the goal is completely correct code.
        Hide
        ASF subversion and git services added a comment -

        Commit 1665405 from Shawn Heisey in branch 'dev/trunk'
        [ https://svn.apache.org/r1665405 ]

        SOLR-7195: bin/solr changes: Escape start.jar in greps. Fix incorrect substring port detection.

        Show
        ASF subversion and git services added a comment - Commit 1665405 from Shawn Heisey in branch 'dev/trunk' [ https://svn.apache.org/r1665405 ] SOLR-7195 : bin/solr changes: Escape start.jar in greps. Fix incorrect substring port detection.
        Hide
        ASF subversion and git services added a comment -

        Commit 1665407 from Shawn Heisey in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1665407 ]

        SOLR-7195: bin/solr changes: Escape start.jar in greps. Fix incorrect substring port detection. (merge trunk r1665405)

        Show
        ASF subversion and git services added a comment - Commit 1665407 from Shawn Heisey in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1665407 ] SOLR-7195 : bin/solr changes: Escape start.jar in greps. Fix incorrect substring port detection. (merge trunk r1665405)
        Hide
        Shawn Heisey added a comment -

        Committed to trunk and merged into branch_5x.

        Show
        Shawn Heisey added a comment - Committed to trunk and merged into branch_5x.
        Hide
        Timothy Potter added a comment -

        Bulk close after 5.1 release

        Show
        Timothy Potter added a comment - Bulk close after 5.1 release

          People

          • Assignee:
            Shawn Heisey
            Reporter:
            Shawn Heisey
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development