Solr
  1. Solr
  2. SOLR-6646

Start script fails to detect solr on non-default port and then after 30s tails wrong log file

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.10.1
    • Fix Version/s: 4.10.2, 5.0, 6.0
    • Component/s: scripts and tools
    • Labels:
      None

      Description

      When starting solr in the background on non-default port, e.g. bin/solr start -p 9999, Solr comes up but the script does not detect it. Then, after 30 seconds, the script tries to tail the log but fails due to hardcoded "node1":

      Waiting to see Solr listening on port 9999 [|]  Still not seeing Solr listening on 9999 after 30 seconds!
      tail: /Users/janhoy/workspace/lucene_solr_4_10/solr/node1/logs/solr.log: No such file or directory
      
      1. SOLR-6646.patch
        2 kB
        Jan Høydahl

        Activity

        Hide
        Jan Høydahl added a comment -

        Reason being hardcoded node1. Should use $SOLR_SERVER_DIR instead of $SOLR_TIP/node1 on line 908.

        This seems to happen only when starting on non-standard port with -p. (I'm on a Mac)

        Show
        Jan Høydahl added a comment - Reason being hardcoded node1 . Should use $SOLR_SERVER_DIR instead of $SOLR_TIP/node1 on line 908. This seems to happen only when starting on non-standard port with -p . (I'm on a Mac)
        Hide
        Jan Høydahl added a comment - - edited

        Appears that when starting Solr/Jetty on port 8983, lsof -i:8983 returns a line with port number in it

        java    16571 janhoy  144u  IPv4 0x6538b54622fd1f05      0t0  TCP *:8983 (LISTEN)
        

        but when starting on e.g. 8080, it returns this

        java    17106 janhoy  144u  IPv4 0x6538b54622fdad65      0t0  TCP *:http-alt (LISTEN)
        

        Therefore the grep in line 901 must go away, as -i itself takes care of filtering on port.

        Show
        Jan Høydahl added a comment - - edited Appears that when starting Solr/Jetty on port 8983, lsof -i:8983 returns a line with port number in it java 16571 janhoy 144u IPv4 0x6538b54622fd1f05 0t0 TCP *:8983 (LISTEN) but when starting on e.g. 8080, it returns this java 17106 janhoy 144u IPv4 0x6538b54622fdad65 0t0 TCP *:http-alt (LISTEN) Therefore the grep in line 901 must go away, as -i itself takes care of filtering on port.
        Hide
        Shawn Heisey added a comment -

        I like to add -Pn to lsof commands - "lsof -Pn -i" in this case. This causes it to not do reverse lookup on IP addresses, and to not use /etc/services to convert port numbers to names. This also conveys another advantage – it usually runs quite a bit faster.

        Show
        Shawn Heisey added a comment - I like to add -Pn to lsof commands - "lsof -Pn -i" in this case. This causes it to not do reverse lookup on IP addresses, and to not use /etc/services to convert port numbers to names. This also conveys another advantage – it usually runs quite a bit faster.
        Hide
        Jan Høydahl added a comment -

        Attaching patch for trunk

        Show
        Jan Høydahl added a comment - Attaching patch for trunk
        Hide
        ASF subversion and git services added a comment -

        Commit 1633962 from janhoy@apache.org in branch 'dev/branches/lucene_solr_4_10'
        [ https://svn.apache.org/r1633962 ]

        SOLR-6646: Start script fails to detect solr on non-default port and then after 30s tails wrong log file (merge from trunk)

        Show
        ASF subversion and git services added a comment - Commit 1633962 from janhoy@apache.org in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1633962 ] SOLR-6646 : Start script fails to detect solr on non-default port and then after 30s tails wrong log file (merge from trunk)
        Hide
        Jan Høydahl added a comment -

        Committed to trunk (r1633960), 5.x (r1633961) and 4.10.x (r1633962)

        Show
        Jan Høydahl added a comment - Committed to trunk (r1633960), 5.x (r1633961) and 4.10.x (r1633962)

          People

          • Assignee:
            Jan Høydahl
            Reporter:
            Jan Høydahl
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development