Solr
  1. Solr
  2. SOLR-6851

Scripts to help install and run Solr as a service on Linux

    Details

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

      Description

      noticed 2 problems with the oom_solr.sh script...

      1) the script is only being run with the port of hte solr instance to terminate, so the log messages aren't getting writen to the correct directory – if we change hte script to take a log dir/file as an argument, we can ensure the logs are written to the correct place

      2) on my ubuntu linux machine (where /bin/sh is a symlink to "/bin/dash"), the console log is recording a script error when java runs oom_solr.sh...

      #
      # java.lang.OutOfMemoryError: Java heap space
      # -XX:OnOutOfMemoryError="/home/hossman/lucene/5x_dev/solr/bin/oom_solr.sh 8983"
      #   Executing /bin/sh -c "/home/hossman/lucene/5x_dev/solr/bin/oom_solr.sh 8983"...
      /home/hossman/lucene/5x_dev/solr/bin/oom_solr.sh: 20: [: 14305: unexpected operator
      Running OOM killer script for process 14305 for Solr on port 8983
      Killed process 14305
      

      steps to reproduce: bin/solr -e techproducts -m 10m

      1. SOLR-6851.patch
        38 kB
        Timothy Potter
      2. SOLR-6851.patch
        37 kB
        Timothy Potter
      3. SOLR-6851.patch
        26 kB
        Timothy Potter

        Issue Links

          Activity

          Hide
          Hoss Man added a comment -

          the script error seems to be an "sh" vs "bash" vs "dash" portability issue with using "=" for string comparisons.

          from a portibility standpoint, probably safer to just use "-z" to check if the string is empty...

          if [ -z "$SOLR_PID" ]; then
          
          Show
          Hoss Man added a comment - the script error seems to be an "sh" vs "bash" vs "dash" portability issue with using "=" for string comparisons. from a portibility standpoint, probably safer to just use "-z" to check if the string is empty... if [ -z "$SOLR_PID" ]; then
          Hide
          Timothy Potter added a comment -

          I'm hijacking this ticket to do some other enhancements needed to support running Solr as a service on *nix, such as being able to keep static Solr files in /opt/solr and user / live files in /var/solr and being able to control Solr using /etc/init.d/solr

          Show
          Timothy Potter added a comment - I'm hijacking this ticket to do some other enhancements needed to support running Solr as a service on *nix, such as being able to keep static Solr files in /opt/solr and user / live files in /var/solr and being able to control Solr using /etc/init.d/solr
          Hide
          Timothy Potter added a comment -

          When I got into dealing with the oom script issue Hossman found, we realized that the PID handling was sub-optimal and overall needed to vet out issues related to running Solr as a service using an /etc/init.d/solr script. This patch has a very simple solution for that.

          I'm working on a Taking Solr to Production page for the ref guide to explain how to structure your environment and how to use the scripts in production.

          Show
          Timothy Potter added a comment - When I got into dealing with the oom script issue Hossman found, we realized that the PID handling was sub-optimal and overall needed to vet out issues related to running Solr as a service using an /etc/init.d/solr script. This patch has a very simple solution for that. I'm working on a Taking Solr to Production page for the ref guide to explain how to structure your environment and how to use the scripts in production.
          Hide
          Timothy Potter added a comment -

          If you're interested in this type of stuff - please give a review of: https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production, which covers features supported by this patch.

          Show
          Timothy Potter added a comment - If you're interested in this type of stuff - please give a review of: https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production , which covers features supported by this patch.
          Hide
          Steve Rowe added a comment -

          Timothy Potter, I went through the new ref guide page following the instructions, using the latest branch_5x with the patch on this issue, on a Debian Linux box I've got.

          1. Is the following section necessary? The vars are already filled in, including RUNAS=ubuntu:

            Next, you need to edit the /etc/init.d/solr file to set the following variables:

            SOLR_INSTALL_DIR=/opt/solr
            RUNAS=???
            SOLR_ENV=/var/solr/solr.in.sh
            


          2. Solr is still running just before the init.d section - we should tell people to stop Solr before starting that section - here's the part where the user has started solr:

            At this point, you can start Solr using the include file to override default settings by doing:

            $ SOLR_INCLUDE=/var/solr/solr.in.sh /opt/solr/bin/solr start
            


          3. bin/init.d/solr is not included in the built distribution - I was able to get it included with this patch to solr/build.xml:
            @@ -485,7 +488,7 @@
                   <tarfileset dir="."
                               filemode="755"
                               prefix="${fullnamever}"
            -                  includes="bin/* server/**/*.sh example/**/*.sh example/**/bin/" />
            +                  includes="bin/** server/**/*.sh example/**/*.sh example/**/bin/" />
                   <tarfileset dir="."
                               prefix="${fullnamever}"
                               includes="dist/*.jar
            


          4. Sometimes commands assume the user is logged in as root, and sometimes they use sudo - seems like for the one-time installation/config stuff, they should stick to one approach? - here's where the first switch happened that I noticed:
            $ sudo chown -R ubuntu: /var/solr
            


          5. When running update-rc.d solr defaults:
            update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match solr Default-Stop values (none)
            


            Is there some reason Solr shouldn't be stopped at run levels 0, 1, and 6?

          6. Why is this necessary?: update-rc.d solr enable (didn't change anything on my box - isn't this only necessary after a update-rc.d XXX disable?)
          7. Under the Progress Check section, when restarting, I get the following:
            mv: cannot move `/opt/solr/server/logs/solr.log' to `/opt/solr/server/logs/solr_log_20141222_0048': Permission denied
            mv: cannot move `/opt/solr/server/logs/solr_gc.log' to `/opt/solr/server/logs/solr_gc_log_20141222_0048': Permission denied
            Waiting to see Solr listening on port 8983/opt/solr/bin/solr: line 1138: /opt/solr/server/logs/solr-8983-console.log: Permission denied
             [-]  Still not seeing Solr listening on 8983 after 30 seconds!
            INFO  - 2014-12-22 05:25:38.930; org.apache.solr.core.SolrResourceLoader; JNDI not configured for solr (NoInitialContextEx)
            INFO  - 2014-12-22 05:25:38.930; org.apache.solr.core.SolrResourceLoader; using system property solr.solr.home: /var/solr/data
            INFO  - 2014-12-22 05:25:38.930; org.apache.solr.core.SolrResourceLoader; new SolrResourceLoader for directory: '/var/solr/data/'
            INFO  - 2014-12-22 05:25:39.025; org.apache.solr.core.ConfigSolr; Loading container configuration from /var/solr/data/solr.xml
            INFO  - 2014-12-22 05:25:39.085; org.apache.solr.core.CorePropertiesLocator; Config-defined core root directory: /var/solr/data
            INFO  - 2014-12-22 05:25:39.090; org.apache.solr.core.CoreContainer; New CoreContainer 18546089
            INFO  - 2014-12-22 05:25:39.091; org.apache.solr.core.CoreContainer; Loading cores into CoreContainer [instanceDir=/var/solr/data/]
            INFO  - 2014-12-22 05:25:39.100; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting socketTimeout to: 0
            INFO  - 2014-12-22 05:25:39.100; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting urlScheme to: null
            INFO  - 2014-12-22 05:25:39.104; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting connTimeout to: 0
            INFO  - 2014-12-22 05:25:39.104; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maxConnectionsPerHost to: 20
            INFO  - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maxConnections to: 10000
            INFO  - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting corePoolSize to: 0
            INFO  - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maximumPoolSize to: 2147483647
            INFO  - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maxThreadIdleTime to: 5
            INFO  - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting sizeOfQueue to: -1
            INFO  - 2014-12-22 05:25:39.107; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting fairnessPolicy to: false
            INFO  - 2014-12-22 05:25:39.202; org.apache.solr.update.UpdateShardHandler; Creating UpdateShardHandler HTTP client with params: socketTimeout=0&connTimeout=0&retry=false
            INFO  - 2014-12-22 05:25:39.204; org.apache.solr.logging.LogWatcher; SLF4J impl is org.slf4j.impl.Log4jLoggerFactory
            INFO  - 2014-12-22 05:25:39.205; org.apache.solr.logging.LogWatcher; Registering Log Listener [Log4j (org.slf4j.impl.Log4jLoggerFactory)]
            INFO  - 2014-12-22 05:25:39.205; org.apache.solr.core.CoreContainer; Host Name: 
            INFO  - 2014-12-22 05:25:39.229; org.apache.solr.core.CorePropertiesLocator; Looking for core definitions underneath /var/solr/data
            INFO  - 2014-12-22 05:25:39.230; org.apache.solr.core.CorePropertiesLocator; Found 0 core definitions
            INFO  - 2014-12-22 05:25:39.231; org.apache.solr.servlet.SolrDispatchFilter; user.dir=/opt/solr-5.0.0/server
            INFO  - 2014-12-22 05:25:39.231; org.apache.solr.servlet.SolrDispatchFilter; SolrDispatchFilter.init() done
            INFO  - 2014-12-22 05:25:39.256; org.eclipse.jetty.server.AbstractConnector; Started SocketConnector@0.0.0.0:8983
            INFO  - 2014-12-22 05:34:33.015; org.eclipse.jetty.server.Server; Graceful shutdown SocketConnector@0.0.0.0:8983
            INFO  - 2014-12-22 05:34:33.016; org.eclipse.jetty.server.Server; Graceful shutdown o.e.j.w.WebAppContext{/solr,file:/opt/solr-5.0.0/server/solr-webapp/webapp/},/opt/solr-5.0.0/server/webapps/solr.war
            INFO  - 2014-12-22 05:34:34.017; org.apache.solr.core.CoreContainer; Shutting down CoreContainer instance=18546089
            INFO  - 2014-12-22 05:34:34.020; org.eclipse.jetty.server.handler.ContextHandler; stopped o.e.j.w.WebAppContext{/solr,file:/opt/solr-5.0.0/server/solr-webapp/webapp/},/opt/solr-5.0.0/server/webapps/solr.war
            


            At this point, Solr isn't running and service solr start does not do the trick.

          8. service solr stop at this point doesn't work (neither does adding '-p 8983' or '-all' at the end):
            Must either specify a port using -p or -all to stop all Solr nodes on this host.
            


            and service solr status says:

            Found 1 Solr nodes: 
            
            Solr process 13440 from /var/solr/solr-8983.pid not found.
            


          9. After handling the log setup, service solr start results in the following in solr.log:
            INFO  - 2014-12-22 06:01:32.762; org.eclipse.jetty.server.Server; jetty-8.1.10.v20130312
            INFO  - 2014-12-22 06:01:32.777; org.eclipse.jetty.deploy.providers.ScanningAppProvider; Deployment monitor /opt/solr-5.0.0/server/contexts at interval 0
            INFO  - 2014-12-22 06:01:32.781; org.eclipse.jetty.deploy.DeploymentManager; Deployable added: /opt/solr-5.0.0/server/contexts/solr-jetty-context.xml
            WARN  - 2014-12-22 06:01:32.811; org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration; Config error at <Set name="tempDirectory"><Property name="jetty.home" defau
            lt="."/>/solr-webapp</Set>
            WARN  - 2014-12-22 06:01:32.812; org.eclipse.jetty.deploy.DeploymentManager; Unable to reach node goal: started
            java.lang.reflect.InvocationTargetException
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:606)
                    at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:561)
                    at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:384)
                    at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:343)
                    at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:296)
                    at org.eclipse.jetty.deploy.providers.ContextProvider.createContextHandler(ContextProvider.java:87)
                    at org.eclipse.jetty.deploy.App.getContextHandler(App.java:100)
                    at org.eclipse.jetty.deploy.bindings.StandardDeployer.processBinding(StandardDeployer.java:36)
                    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
                    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:494)
                    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:141)
                    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:145)
                    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:56)
                    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
                    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540)
                    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403)
                    at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337)
                    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
                    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:121)
                    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
                    at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:555)
                    at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:230)
                    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
                    at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:81)
                    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
                    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:96)
                    at org.eclipse.jetty.server.Server.doStart(Server.java:280)
                    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
                    at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1259)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1182)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:606)
                    at org.eclipse.jetty.start.Main.invokeMain(Main.java:473)
                    at org.eclipse.jetty.start.Main.start(Main.java:615)
                    at org.eclipse.jetty.start.Main.main(Main.java:96)
            Caused by: java.lang.IllegalArgumentException: Bad temp directory: /opt/solr-5.0.0/server/solr-webapp
                    at org.eclipse.jetty.webapp.WebAppContext.setTempDirectory(WebAppContext.java:1129)
                    ... 41 more
            INFO  - 2014-12-22 06:01:32.817; org.eclipse.jetty.server.AbstractConnector; Started SocketConnector@0.0.0.0:8983
            

          That's as far as I got.

          Show
          Steve Rowe added a comment - Timothy Potter , I went through the new ref guide page following the instructions, using the latest branch_5x with the patch on this issue, on a Debian Linux box I've got. Is the following section necessary? The vars are already filled in, including RUNAS=ubuntu : Next, you need to edit the /etc/init.d/solr file to set the following variables: SOLR_INSTALL_DIR=/opt/solr RUNAS=??? SOLR_ENV=/var/solr/solr.in.sh Solr is still running just before the init.d section - we should tell people to stop Solr before starting that section - here's the part where the user has started solr: At this point, you can start Solr using the include file to override default settings by doing: $ SOLR_INCLUDE=/var/solr/solr.in.sh /opt/solr/bin/solr start bin/init.d/solr is not included in the built distribution - I was able to get it included with this patch to solr/build.xml : @@ -485,7 +488,7 @@ <tarfileset dir= "." filemode= "755" prefix= "${fullnamever}" - includes= "bin/* server/**/*.sh example/**/*.sh example/**/bin/" /> + includes= "bin/** server/**/*.sh example/**/*.sh example/**/bin/" /> <tarfileset dir= "." prefix= "${fullnamever}" includes="dist/*.jar Sometimes commands assume the user is logged in as root, and sometimes they use sudo - seems like for the one-time installation/config stuff, they should stick to one approach? - here's where the first switch happened that I noticed: $ sudo chown -R ubuntu: /var/solr When running update-rc.d solr defaults : update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match solr Default-Stop values (none) Is there some reason Solr shouldn't be stopped at run levels 0, 1, and 6? Why is this necessary?: update-rc.d solr enable (didn't change anything on my box - isn't this only necessary after a update-rc.d XXX disable ?) Under the Progress Check section, when restarting, I get the following: mv: cannot move `/opt/solr/server/logs/solr.log' to `/opt/solr/server/logs/solr_log_20141222_0048': Permission denied mv: cannot move `/opt/solr/server/logs/solr_gc.log' to `/opt/solr/server/logs/solr_gc_log_20141222_0048': Permission denied Waiting to see Solr listening on port 8983/opt/solr/bin/solr: line 1138: /opt/solr/server/logs/solr-8983-console.log: Permission denied [-] Still not seeing Solr listening on 8983 after 30 seconds! INFO - 2014-12-22 05:25:38.930; org.apache.solr.core.SolrResourceLoader; JNDI not configured for solr (NoInitialContextEx) INFO - 2014-12-22 05:25:38.930; org.apache.solr.core.SolrResourceLoader; using system property solr.solr.home: /var/solr/data INFO - 2014-12-22 05:25:38.930; org.apache.solr.core.SolrResourceLoader; new SolrResourceLoader for directory: '/var/solr/data/' INFO - 2014-12-22 05:25:39.025; org.apache.solr.core.ConfigSolr; Loading container configuration from /var/solr/data/solr.xml INFO - 2014-12-22 05:25:39.085; org.apache.solr.core.CorePropertiesLocator; Config-defined core root directory: /var/solr/data INFO - 2014-12-22 05:25:39.090; org.apache.solr.core.CoreContainer; New CoreContainer 18546089 INFO - 2014-12-22 05:25:39.091; org.apache.solr.core.CoreContainer; Loading cores into CoreContainer [instanceDir=/var/solr/data/] INFO - 2014-12-22 05:25:39.100; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting socketTimeout to: 0 INFO - 2014-12-22 05:25:39.100; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting urlScheme to: null INFO - 2014-12-22 05:25:39.104; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting connTimeout to: 0 INFO - 2014-12-22 05:25:39.104; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maxConnectionsPerHost to: 20 INFO - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maxConnections to: 10000 INFO - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting corePoolSize to: 0 INFO - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maximumPoolSize to: 2147483647 INFO - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maxThreadIdleTime to: 5 INFO - 2014-12-22 05:25:39.106; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting sizeOfQueue to: -1 INFO - 2014-12-22 05:25:39.107; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting fairnessPolicy to: false INFO - 2014-12-22 05:25:39.202; org.apache.solr.update.UpdateShardHandler; Creating UpdateShardHandler HTTP client with params: socketTimeout=0&connTimeout=0&retry=false INFO - 2014-12-22 05:25:39.204; org.apache.solr.logging.LogWatcher; SLF4J impl is org.slf4j.impl.Log4jLoggerFactory INFO - 2014-12-22 05:25:39.205; org.apache.solr.logging.LogWatcher; Registering Log Listener [Log4j (org.slf4j.impl.Log4jLoggerFactory)] INFO - 2014-12-22 05:25:39.205; org.apache.solr.core.CoreContainer; Host Name: INFO - 2014-12-22 05:25:39.229; org.apache.solr.core.CorePropertiesLocator; Looking for core definitions underneath /var/solr/data INFO - 2014-12-22 05:25:39.230; org.apache.solr.core.CorePropertiesLocator; Found 0 core definitions INFO - 2014-12-22 05:25:39.231; org.apache.solr.servlet.SolrDispatchFilter; user.dir=/opt/solr-5.0.0/server INFO - 2014-12-22 05:25:39.231; org.apache.solr.servlet.SolrDispatchFilter; SolrDispatchFilter.init() done INFO - 2014-12-22 05:25:39.256; org.eclipse.jetty.server.AbstractConnector; Started SocketConnector@0.0.0.0:8983 INFO - 2014-12-22 05:34:33.015; org.eclipse.jetty.server.Server; Graceful shutdown SocketConnector@0.0.0.0:8983 INFO - 2014-12-22 05:34:33.016; org.eclipse.jetty.server.Server; Graceful shutdown o.e.j.w.WebAppContext{/solr,file:/opt/solr-5.0.0/server/solr-webapp/webapp/},/opt/solr-5.0.0/server/webapps/solr.war INFO - 2014-12-22 05:34:34.017; org.apache.solr.core.CoreContainer; Shutting down CoreContainer instance=18546089 INFO - 2014-12-22 05:34:34.020; org.eclipse.jetty.server.handler.ContextHandler; stopped o.e.j.w.WebAppContext{/solr,file:/opt/solr-5.0.0/server/solr-webapp/webapp/},/opt/solr-5.0.0/server/webapps/solr.war At this point, Solr isn't running and service solr start does not do the trick. service solr stop at this point doesn't work (neither does adding '-p 8983' or '-all' at the end): Must either specify a port using -p or -all to stop all Solr nodes on this host. and service solr status says: Found 1 Solr nodes: Solr process 13440 from /var/solr/solr-8983.pid not found. After handling the log setup, service solr start results in the following in solr.log : INFO - 2014-12-22 06:01:32.762; org.eclipse.jetty.server.Server; jetty-8.1.10.v20130312 INFO - 2014-12-22 06:01:32.777; org.eclipse.jetty.deploy.providers.ScanningAppProvider; Deployment monitor /opt/solr-5.0.0/server/contexts at interval 0 INFO - 2014-12-22 06:01:32.781; org.eclipse.jetty.deploy.DeploymentManager; Deployable added: /opt/solr-5.0.0/server/contexts/solr-jetty-context.xml WARN - 2014-12-22 06:01:32.811; org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration; Config error at <Set name="tempDirectory"><Property name="jetty.home" defau lt="."/>/solr-webapp</Set> WARN - 2014-12-22 06:01:32.812; org.eclipse.jetty.deploy.DeploymentManager; Unable to reach node goal: started java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:561) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:384) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:343) at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:296) at org.eclipse.jetty.deploy.providers.ContextProvider.createContextHandler(ContextProvider.java:87) at org.eclipse.jetty.deploy.App.getContextHandler(App.java:100) at org.eclipse.jetty.deploy.bindings.StandardDeployer.processBinding(StandardDeployer.java:36) at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186) at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:494) at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:141) at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:145) at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:56) at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609) at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540) at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403) at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:121) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:555) at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:230) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:81) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:96) at org.eclipse.jetty.server.Server.doStart(Server.java:280) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1259) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1182) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.jetty.start.Main.invokeMain(Main.java:473) at org.eclipse.jetty.start.Main.start(Main.java:615) at org.eclipse.jetty.start.Main.main(Main.java:96) Caused by: java.lang.IllegalArgumentException: Bad temp directory: /opt/solr-5.0.0/server/solr-webapp at org.eclipse.jetty.webapp.WebAppContext.setTempDirectory(WebAppContext.java:1129) ... 41 more INFO - 2014-12-22 06:01:32.817; org.eclipse.jetty.server.AbstractConnector; Started SocketConnector@0.0.0.0:8983 That's as far as I got.
          Hide
          Timothy Potter added a comment - - edited

          Updated patch now includes a helper script that performs the service installation tasks described in the ref guide (https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production), see bin/install_solr_service.sh

          I've only tested it on Red Hat, Ubuntu, SUSE, and Debian ... we can add support for additional Linux distros in the future.

          Show
          Timothy Potter added a comment - - edited Updated patch now includes a helper script that performs the service installation tasks described in the ref guide ( https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production ), see bin/install_solr_service.sh I've only tested it on Red Hat, Ubuntu, SUSE, and Debian ... we can add support for additional Linux distros in the future.
          Hide
          Timothy Potter added a comment -

          Steve Rowe Thanks for the detailed review. I believe I've addressed all the issues you found with this new patch and edits to the ref guide. Please kick the tires on the bin/install_solr_service.sh script if you have a chance.

          Show
          Timothy Potter added a comment - Steve Rowe Thanks for the detailed review. I believe I've addressed all the issues you found with this new patch and edits to the ref guide. Please kick the tires on the bin/install_solr_service.sh script if you have a chance.
          Hide
          Timothy Potter added a comment -

          Ignore the previous patch ... newest one has better error handling and accepts a -p option to override the default port 8983, which is needed for installing multiple nodes on the same host.

          Show
          Timothy Potter added a comment - Ignore the previous patch ... newest one has better error handling and accepts a -p option to override the default port 8983, which is needed for installing multiple nodes on the same host.
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-6851: Scripts to help install and run Solr as a service on Linux

          Show
          ASF subversion and git services added a comment - Commit 1647700 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1647700 ] SOLR-6851 : Scripts to help install and run Solr as a service on Linux
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-6851: Scripts to help install and run Solr as a service on Linux

          Show
          ASF subversion and git services added a comment - Commit 1647813 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1647813 ] SOLR-6851 : Scripts to help install and run Solr as a service on Linux
          Hide
          Timothy Potter added a comment -

          Re-opening (since this isn't released yet) to add one minor improvement suggested by Hoss Man, namely - the SOLR_VAR_DIR should be determined using the service name so the user can just use -s and skip passing -d, i.e.

          sudo bash ./install_solr_service.sh solr-5.0.0.tgz -s solr2 -p 8984
          

          will setup the "solr2" service in /var/solr2 automatically.

          Show
          Timothy Potter added a comment - Re-opening (since this isn't released yet) to add one minor improvement suggested by Hoss Man , namely - the SOLR_VAR_DIR should be determined using the service name so the user can just use -s and skip passing -d, i.e. sudo bash ./install_solr_service.sh solr-5.0.0.tgz -s solr2 -p 8984 will setup the "solr2" service in /var/solr2 automatically.
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-6851: Set the SOLR_VAR_DIR using the SOLR_SERVICE variable, thus alleviating the need to specify the -d option when overrding the service name with -s

          Show
          ASF subversion and git services added a comment - Commit 1651435 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1651435 ] SOLR-6851 : Set the SOLR_VAR_DIR using the SOLR_SERVICE variable, thus alleviating the need to specify the -d option when overrding the service name with -s
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-6851: Set the SOLR_VAR_DIR using the SOLR_SERVICE variable, thus alleviating the need to specify the -d option when overrding the service name with -s

          Show
          ASF subversion and git services added a comment - Commit 1651436 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1651436 ] SOLR-6851 : Set the SOLR_VAR_DIR using the SOLR_SERVICE variable, thus alleviating the need to specify the -d option when overrding the service name with -s
          Hide
          Jan Høydahl added a comment -

          Good stuff! Did some small typo fixes in the refguide chapter.

          Have not run the install script yet, but here are some initial thoughts (not criticism, just thoughts) :

          • The script install_solr_service.sh installs Solr, not only a the service/daemon scipt. Why not simply install_solr? We already have a tradition to skip the .sh suffix on Linux, and shorter is better.
          • Should the script reside on the top-level in the tarball, so extracting it is simply tar xzf solr-5.0.0.tgz install_solr?
          • If no args passed, and there are solr-?-?-?.[tgz|zip] file(s) in CWD, then we could assume the most recent one. Also would be nice that if no args passed, enter interactive mode, unless -q (quiet) given
          • Script should show help for -h and --help as well, I always find it weird with multi-char options after single dash
          • Looks weird with /var/solr/data/data/... - could we simply choose /var/solr/home for Solr home? Also, after completing SOLR-6671 we could make data dir configurable and let it default to /var/solr/data
          • If starting to adopt POSIX style locations, why not go all in and use /etc/solr/ for solr.solr.home, /var/solr/data for solr.data.home, /var/run/solr/ for PIDs and /var/log/solr/ for logs? That's probably where a random Unix sysadmin would look first
          Show
          Jan Høydahl added a comment - Good stuff! Did some small typo fixes in the refguide chapter. Have not run the install script yet, but here are some initial thoughts (not criticism, just thoughts) : The script install_solr_service.sh installs Solr, not only a the service/daemon scipt. Why not simply install_solr ? We already have a tradition to skip the .sh suffix on Linux, and shorter is better. Should the script reside on the top-level in the tarball, so extracting it is simply tar xzf solr-5.0.0.tgz install_solr ? If no args passed, and there are solr-?-?-?.[tgz|zip] file(s) in CWD, then we could assume the most recent one. Also would be nice that if no args passed, enter interactive mode, unless -q (quiet) given Script should show help for -h and --help  as well, I always find it weird with multi-char options after single dash Looks weird with /var/solr/data/data/... - could we simply choose /var/solr/home for Solr home? Also, after completing SOLR-6671 we could make data dir configurable and let it default to /var/solr/data If starting to adopt POSIX style locations, why not go all in and use /etc/solr/ for solr.solr.home, /var/solr/data for solr.data.home, /var/run/solr/ for PIDs and /var/log/solr/ for logs? That's probably where a random Unix sysadmin would look first
          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:
              Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development