Start up script for solr?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Start up script for solr?

Jack L
Hi,

Sorry that this is not strictly a solr specific question -

I wonder if anyone has a script to start solr on Linux when the
system boots up? Or better yet, supports shutdown and restart?

--
Thanks,
Jack

Reply | Threaded
Open this post in threaded view
|

Re: Start up script for solr?

Peter Manis
I blogged about it last month, here ya go.

http://www.digital39.com/programming/solr-chkconfig-and-startstop-scripts/2007/07/304/

 - Pete

On 8/19/07, Jack L <[hidden email]> wrote:

> Hi,
>
> Sorry that this is not strictly a solr specific question -
>
> I wonder if anyone has a script to start solr on Linux when the
> system boots up? Or better yet, supports shutdown and restart?
>
> --
> Thanks,
> Jack
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Start up script for solr?

Peter Manis
I forgot to mention, that is for a RHEL box, but can easily be
adapted.  It will work like the standard scripts for RHEL

/etc/init.d/solr start
/etc/init.d/solr stop
/etc/init.d/solr restart

or you can just run the solr.start and solr.stop scripts individually

On 8/19/07, Peter Manis <[hidden email]> wrote:

> I blogged about it last month, here ya go.
>
> http://www.digital39.com/programming/solr-chkconfig-and-startstop-scripts/2007/07/304/
>
>  - Pete
>
> On 8/19/07, Jack L <[hidden email]> wrote:
> > Hi,
> >
> > Sorry that this is not strictly a solr specific question -
> >
> > I wonder if anyone has a script to start solr on Linux when the
> > system boots up? Or better yet, supports shutdown and restart?
> >
> > --
> > Thanks,
> > Jack
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: Start up script for solr?

Peter Manis
In reply to this post by Peter Manis
Interesting, it worked fine on the server.  Try moving the -stop at
the end of the line to just before the -jar.

- Pete

On 8/19/07, Jack L <[hidden email]> wrote:

> Hello Peter,
>
> Many thanks!
>
> solr.start works fine but I'm getting an error with solr.stop and solr is not being stopped:
> (I've replaced my app dir with /opt/directory in the log:
>
> $ /etc/init.d/solr stop
> Stopping Solr... java.net.BindException: Address already in use
> WARN: Not listening on monitor port: 8079
> 2007-08-19 15:23:02.533::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
> 2007-08-19 15:23:02.563::WARN:  EXCEPTION
> java.io.FileNotFoundException: /opt/directory/-stop (No such file or directory)
>         at java.io.FileInputStream.open(Native Method)
>         at java.io.FileInputStream.<init>(FileInputStream.java:106)
>         at java.io.FileInputStream.<init>(FileInputStream.java:66)
>         at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
>         at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
>         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653)
>         at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
>         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
>         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
>         at org.mortbay.xml.XmlParser.parse(XmlParser.java:188)
>         at org.mortbay.xml.XmlParser.parse(XmlParser.java:204)
>         at org.mortbay.xml.XmlConfiguration.<init>(XmlConfiguration.java:100)
>         at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:916)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.mortbay.start.Main.invokeMain(Main.java:183)
>         at org.mortbay.start.Main.start(Main.java:497)
>         at org.mortbay.start.Main.main(Main.java:115)
> OK
>
>
> --
> Best regards,
> Jack
>
> Sunday, August 19, 2007, 11:43:16 AM, you wrote:
>
> > I blogged about it last month, here ya go.
>
> > http://www.digital39.com/programming/solr-chkconfig-and-startstop-scripts/2007/07/304/
>
> >  - Pete
>
> > On 8/19/07, Jack L <[hidden email]> wrote:
> >> Hi,
> >>
> >> Sorry that this is not strictly a solr specific question -
> >>
> >> I wonder if anyone has a script to start solr on Linux when the
> >> system boots up? Or better yet, supports shutdown and restart?
> >>
> >> --
> >> Thanks,
> >> Jack
> >>
> >>
>
>
Reply | Threaded
Open this post in threaded view
|

Re[4]: Start up script for solr?

Jack L

If I remove -stop, it'll start another instance or solr and it will fail
because the port has been taken by the first solr instance ...

--
Best regards,
Jack

Sunday, August 19, 2007, 12:35:00 PM, you wrote:

> Interesting, it worked fine on the server.  Try moving the -stop at
> the end of the line to just before the -jar.

> - Pete

> On 8/19/07, Jack L <[hidden email]> wrote:
>> Hello Peter,
>>
>> Many thanks!
>>
>> solr.start works fine but I'm getting an error with solr.stop and solr is not being stopped:
>> (I've replaced my app dir with /opt/directory in the log:
>>
>> $ /etc/init.d/solr stop
>> Stopping Solr... java.net.BindException: Address already in use
>> WARN: Not listening on monitor port: 8079
>> 2007-08-19 15:23:02.533::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
>> 2007-08-19 15:23:02.563::WARN:  EXCEPTION
>> java.io.FileNotFoundException: /opt/directory/-stop (No such file or directory)
>>         at java.io.FileInputStream.open(Native Method)
>>         at java.io.FileInputStream.<init>(FileInputStream.java:106)
>>         at java.io.FileInputStream.<init>(FileInputStream.java:66)
>>         at
>> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
>>         at
>> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
>>         at
>> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653)
>>         at
>> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
>>         at
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
>>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
>>         at org.mortbay.xml.XmlParser.parse(XmlParser.java:188)
>>         at org.mortbay.xml.XmlParser.parse(XmlParser.java:204)
>>         at
>> org.mortbay.xml.XmlConfiguration.<init>(XmlConfiguration.java:100)
>>         at
>> org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:916)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>         at org.mortbay.start.Main.invokeMain(Main.java:183)
>>         at org.mortbay.start.Main.start(Main.java:497)
>>         at org.mortbay.start.Main.main(Main.java:115)
>> OK
>>
>>
>> --
>> Best regards,
>> Jack
>>
>> Sunday, August 19, 2007, 11:43:16 AM, you wrote:
>>
>> > I blogged about it last month, here ya go.
>>
>> >
>> http://www.digital39.com/programming/solr-chkconfig-and-startstop-scripts/2007/07/304/
>>
>> >  - Pete
>>
>> > On 8/19/07, Jack L <[hidden email]> wrote:
>> >> Hi,
>> >>
>> >> Sorry that this is not strictly a solr specific question -
>> >>
>> >> I wonder if anyone has a script to start solr on Linux when the
>> >> system boots up? Or better yet, supports shutdown and restart?
>> >>
>> >> --
>> >> Thanks,
>> >> Jack
>> >>
>> >>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re[4]: Start up script for solr?

Jack L
In reply to this post by Peter Manis
Sorry. If I move it to before -jar, I get:

Unrecognized option: -stop
Could not create the Java virtual machine.


Sunday, August 19, 2007, 12:35:00 PM, you wrote:

> Interesting, it worked fine on the server.  Try moving the -stop at
> the end of the line to just before the -jar.

> - Pete

> On 8/19/07, Jack L <[hidden email]> wrote:
>> Hello Peter,
>>
>> Many thanks!
>>
>> solr.start works fine but I'm getting an error with solr.stop and solr is not being stopped:
>> (I've replaced my app dir with /opt/directory in the log:
>>
>> $ /etc/init.d/solr stop
>> Stopping Solr... java.net.BindException: Address already in use
>> WARN: Not listening on monitor port: 8079
>> 2007-08-19 15:23:02.533::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
>> 2007-08-19 15:23:02.563::WARN:  EXCEPTION
>> java.io.FileNotFoundException: /opt/directory/-stop (No such file or directory)
>>         at java.io.FileInputStream.open(Native Method)
>>         at java.io.FileInputStream.<init>(FileInputStream.java:106)
>>         at java.io.FileInputStream.<init>(FileInputStream.java:66)
>>         at
>> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
>>         at
>> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
>>         at
>> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653)
>>         at
>> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
>>         at
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
>>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
>>         at org.mortbay.xml.XmlParser.parse(XmlParser.java:188)
>>         at org.mortbay.xml.XmlParser.parse(XmlParser.java:204)
>>         at
>> org.mortbay.xml.XmlConfiguration.<init>(XmlConfiguration.java:100)
>>         at
>> org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:916)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>         at org.mortbay.start.Main.invokeMain(Main.java:183)
>>         at org.mortbay.start.Main.start(Main.java:497)
>>         at org.mortbay.start.Main.main(Main.java:115)
>> OK
>>
>>
>> --
>> Best regards,
>> Jack
>>
>> Sunday, August 19, 2007, 11:43:16 AM, you wrote:
>>
>> > I blogged about it last month, here ya go.
>>
>> >
>> http://www.digital39.com/programming/solr-chkconfig-and-startstop-scripts/2007/07/304/
>>
>> >  - Pete
>>
>> > On 8/19/07, Jack L <[hidden email]> wrote:
>> >> Hi,
>> >>
>> >> Sorry that this is not strictly a solr specific question -
>> >>
>> >> I wonder if anyone has a script to start solr on Linux when the
>> >> system boots up? Or better yet, supports shutdown and restart?
>> >>
>> >> --
>> >> Thanks,
>> >> Jack
>> >>
>> >>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re[4]: Start up script for solr?

Jack L
In reply to this post by Peter Manis
Actually it's --stop. Thanks!

> Interesting, it worked fine on the server.  Try moving the -stop at
> the end of the line to just before the -jar.

> - Pete


Reply | Threaded
Open this post in threaded view
|

Re: Re[4]: Start up script for solr?

Peter Manis
Sorry about that, I left out the 2nd dash when I added it to the blog.
 Glad it is working now

On 8/19/07, Jack L <[hidden email]> wrote:
> Actually it's --stop. Thanks!
>
> > Interesting, it worked fine on the server.  Try moving the -stop at
> > the end of the line to just before the -jar.
>
> > - Pete
>
>
>