Solr
  1. Solr
  2. SOLR-7293

Install script makes solr not listen on ipv6 socket

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.1, 6.0
    • Component/s: Server
    • Labels:
    • Environment:

      Centos 7

      Description

      When installing solr with the install script (documentation https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production) the process only listens on an IPv4 socket. > *8983

      When manually installing with the same software set but running the software via a tomcat startup it does listen on ipv4 and IPv6 sockets. > :::8080

      I do realize that I have different ports, it's about 2 servers. I intentionally did not change port of the IPv6 only server to be exact and presize and maybe running it via Tomcat affects this.

      vim /etc/tomcat/web.xml
      
          <env-entry> 
             <env-entry-name>solr/home</env-entry-name> 
             <env-entry-value>/home/solr</env-entry-value> 
             <env-entry-type>java.lang.String</env-entry-type> 
          </env-entry>
      
      cp /tmp/solr-5.0.0/server/webapps/solr.war /var/lib/tomcat/webapps/
      service tomcat start
      
      1. SOLR-7293.patch
        0.9 kB
        Uwe Schindler

        Activity

        Hide
        Uwe Schindler added a comment -

        I agree this is an issue. It is caused by the "bin/solr" and "bin/solr.cmd" command, it passes: -Djava.net.preferIPv4Stack=true to the JVM (for no reason). The fix is to remove this incorrect setting. This affects borth the windows and also the linux/posix startup script.

        We should simply remove this. I did not know that we have added this, otherwise I would have complained already!

        Show
        Uwe Schindler added a comment - I agree this is an issue. It is caused by the "bin/solr" and "bin/solr.cmd" command, it passes: -Djava.net.preferIPv4Stack=true to the JVM (for no reason). The fix is to remove this incorrect setting. This affects borth the windows and also the linux/posix startup script. We should simply remove this. I did not know that we have added this, otherwise I would have complained already!
        Hide
        Uwe Schindler added a comment -

        Attached is a patch that fixes those startup scripts.

        Maybe somebody from the other SOlr committers shoudl comment on this. Nowaydays this is a big issue to pass such settings by default. If somebody has problems with IPv6 one can pass this startup option as needed.

        Show
        Uwe Schindler added a comment - Attached is a patch that fixes those startup scripts. Maybe somebody from the other SOlr committers shoudl comment on this. Nowaydays this is a big issue to pass such settings by default. If somebody has problems with IPv6 one can pass this startup option as needed.
        Hide
        Sebastian Pesman added a comment -

        I've removed the line from /opt/solr/bin/solr and restarted it. It now works on my IPv6 only servers. Awesome.

        Show
        Sebastian Pesman added a comment - I've removed the line from /opt/solr/bin/solr and restarted it. It now works on my IPv6 only servers. Awesome.
        Hide
        Uwe Schindler added a comment -

        By the way, Policeman Jenkins server has IPv6 by default, so we have enough test capacity:

        ;; ANSWER SECTION:
        jenkins.thetaphi.de.    28800   IN      CNAME   serv1.sd-datasolutions.de.
        serv1.sd-datasolutions.de. 300  IN      AAAA    2001:4dd0:ff00:1475::2
        serv1.sd-datasolutions.de. 300  IN      A       188.138.57.78
        

        If somebody wants to test with IPv6 and does not have it already, we can test it without problems.

        In any case we should check the SolrCloud URL stuff to check if those can handle ipv6 Solr URLs!

        Show
        Uwe Schindler added a comment - By the way, Policeman Jenkins server has IPv6 by default, so we have enough test capacity: ;; ANSWER SECTION: jenkins.thetaphi.de. 28800 IN CNAME serv1.sd-datasolutions.de. serv1.sd-datasolutions.de. 300 IN AAAA 2001:4dd0:ff00:1475::2 serv1.sd-datasolutions.de. 300 IN A 188.138.57.78 If somebody wants to test with IPv6 and does not have it already, we can test it without problems. In any case we should check the SolrCloud URL stuff to check if those can handle ipv6 Solr URLs!
        Hide
        ASF subversion and git services added a comment -

        Commit 1669197 from Uwe Schindler in branch 'dev/trunk'
        [ https://svn.apache.org/r1669197 ]

        SOLR-7293: Fix bug that Solr server does not listen on IPv6 interfaces by default

        Show
        ASF subversion and git services added a comment - Commit 1669197 from Uwe Schindler in branch 'dev/trunk' [ https://svn.apache.org/r1669197 ] SOLR-7293 : Fix bug that Solr server does not listen on IPv6 interfaces by default
        Hide
        ASF subversion and git services added a comment -

        Commit 1669198 from Uwe Schindler in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1669198 ]

        Merged revision(s) 1669197 from lucene/dev/trunk:
        SOLR-7293: Fix bug that Solr server does not listen on IPv6 interfaces by default

        Show
        ASF subversion and git services added a comment - Commit 1669198 from Uwe Schindler in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1669198 ] Merged revision(s) 1669197 from lucene/dev/trunk: SOLR-7293 : Fix bug that Solr server does not listen on IPv6 interfaces by default
        Hide
        Uwe Schindler added a comment -

        Thanks for reporting!

        Show
        Uwe Schindler added a comment - Thanks for reporting!
        Hide
        Shalin Shekhar Mangar added a comment -

        Uwe, in my experience, not having that JVM flag leads to inordinately long DNS lookup times when you are only using ipv4 (it may have been an incorrectly configured DNS server). So if someone is using ipv4 only, I always recommend to have this flag on.

        Show
        Shalin Shekhar Mangar added a comment - Uwe, in my experience, not having that JVM flag leads to inordinately long DNS lookup times when you are only using ipv4 (it may have been an incorrectly configured DNS server). So if someone is using ipv4 only, I always recommend to have this flag on.
        Hide
        Uwe Schindler added a comment -

        This is not correct, only if the computer is wrongly configured! The problem only happens if you have a wrongly configured IPv6 interface (missing gateway). That's not different from a broken additional interface with a 169er IP

        But we cannot prevent people with IPv6 from working correctly. So anybody can pass whatever arguments to his JVM already, but disabling IPv6 on machinbes with IPv6 is a big no-go, sorry! This was a regression introduced with Solr 5.0, before it was all fine if you started with java -jar start.jar

        Show
        Uwe Schindler added a comment - This is not correct, only if the computer is wrongly configured! The problem only happens if you have a wrongly configured IPv6 interface (missing gateway). That's not different from a broken additional interface with a 169er IP But we cannot prevent people with IPv6 from working correctly. So anybody can pass whatever arguments to his JVM already, but disabling IPv6 on machinbes with IPv6 is a big no-go, sorry! This was a regression introduced with Solr 5.0, before it was all fine if you started with java -jar start.jar
        Hide
        Uwe Schindler added a comment -

        In fact what happens when you have those slowdowns: DNS servers always return IPv6 addresses if they exist - there are no wrongly configured DNS servers (also IPv4 only DNS servers will return IPv6 addresses and they must). The problem is if you have a incomplete configured global, non link-local IPv6 address on one of your interfaces (see above). Because of that it will use it to connect and fails with timeout.

        People that have broken setups can disable IPv6 in the Linux kernel, and many do.

        Show
        Uwe Schindler added a comment - In fact what happens when you have those slowdowns: DNS servers always return IPv6 addresses if they exist - there are no wrongly configured DNS servers (also IPv4 only DNS servers will return IPv6 addresses and they must). The problem is if you have a incomplete configured global, non link-local IPv6 address on one of your interfaces (see above). Because of that it will use it to connect and fails with timeout. People that have broken setups can disable IPv6 in the Linux kernel, and many do.
        Hide
        Shalin Shekhar Mangar added a comment -

        I am not saying that we shouldn't support ipv6 but ipv6 users are few and the error they get is easily found and fixed (by removing the prefer IPv4 JVM flag). But removing the JVM param can cause bad performance for many IPv4 users to whom the reason and solution may not be apparent.

        Show
        Shalin Shekhar Mangar added a comment - I am not saying that we shouldn't support ipv6 but ipv6 users are few and the error they get is easily found and fixed (by removing the prefer IPv4 JVM flag). But removing the JVM param can cause bad performance for many IPv4 users to whom the reason and solution may not be apparent.
        Hide
        Uwe Schindler added a comment -

        This is no reason to revert this. Those users will have the same problem with all other apps on their computer, too.

        You may not have noticed, but in Europe we are already out of IPv4 addresses, so maaany people use IPv6 already (including me). I am changing with my laptop between many networks (some with IPv6 and some without) and never had any slowdowns. Problem like you describe only happen with very old Ubuntu distributions (I know what you mean, but this is solved since long time).

        Show
        Uwe Schindler added a comment - This is no reason to revert this. Those users will have the same problem with all other apps on their computer, too. You may not have noticed, but in Europe we are already out of IPv4 addresses, so maaany people use IPv6 already (including me). I am changing with my laptop between many networks (some with IPv6 and some without) and never had any slowdowns. Problem like you describe only happen with very old Ubuntu distributions (I know what you mean, but this is solved since long time).
        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:
            Uwe Schindler
            Reporter:
            Sebastian Pesman
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development