Administrative questions

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

Administrative questions

Jon Drukman
1. How do people deal with having solr start when system reboots, manage
the log output, etc.  Right now I run it manually under a unix 'screen'
command with a wrapper script that takes care of restarts when it
crashes.  That means that only my user can connect to it, and it can't
happen when the system starts up... But I don't see any other way to
control the process easily.

2. Is there any way to modify a schema without stopping the process,
destroying the existing index, then restarting and reloading all the
data?  It doesn't take that long and we're not in production yet, but
once we're live I can't see that being feasible.

-jsd-

Reply | Threaded
Open this post in threaded view
|

Re: Administrative questions

Jason Rennie-2
On Tue, Aug 12, 2008 at 8:49 PM, Jon Drukman <[hidden email]> wrote:

> 1. How do people deal with having solr start when system reboots, manage
> the log output, etc.  Right now I run it manually under a unix 'screen'
> command with a wrapper script that takes care of restarts when it crashes.
>  That means that only my user can connect to it, and it can't happen when
> the system starts up... But I don't see any other way to control the process
> easily.
>

We use daemontools.  Restarts solr whenever it goes down (for whatever
reason) and directs output to a set of rotated log files.  Very handy for a
production environment.  A bit tricky to set, but solid once you have it in
place.

http://cr.yp.to/daemontools.html

Jason

--
Jason Rennie
Head of Machine Learning Technologies, StyleFeeder
http://www.stylefeeder.com/
Samantha's blog & pictures: http://samanthalyrarennie.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Administrative questions

Jon Drukman
Jason Rennie wrote:

> On Tue, Aug 12, 2008 at 8:49 PM, Jon Drukman <[hidden email]> wrote:
>
>> 1. How do people deal with having solr start when system reboots, manage
>> the log output, etc.  Right now I run it manually under a unix 'screen'
>> command with a wrapper script that takes care of restarts when it crashes.
>>  That means that only my user can connect to it, and it can't happen when
>> the system starts up... But I don't see any other way to control the process
>> easily.
>>
>
> We use daemontools.  Restarts solr whenever it goes down (for whatever
> reason) and directs output to a set of rotated log files.  Very handy for a
> production environment.  A bit tricky to set, but solid once you have it in
> place.
>
> http://cr.yp.to/daemontools.html

*facepalm*

Duh.  I should have thought of that.  I'm a big fan of djbdns so I'm
quite familiar with daemontools.

Thanks!

-jsd-

Reply | Threaded
Open this post in threaded view
|

RE: Administrative questions

Lance Norskog-2
In reply to this post by Jon Drukman
I wrote shell tasks that start, stop, and heartbeat the server and run them
from cron (unix). Heartbeat means: 1) is the tomcat even running, 2) does
tomcat return the Solr admin page, 3) does Solr return a search. For an
indexer, 4) does solr return from a commit. Stopping the server via the
tomcat shutdown often fails or hangs, so the sequence is: shutdown, two
minutes, kill (like a ^C), 30 seconds, kill -9 (not ignoreable). If any of
these fail, we get email.

What I also want is a program that quickly verifies that the index file is
not corrupted. That would make me feel better about automatically deleting
old snapshots.

For Multicore, I'd like something that watches a directory for new cores and
automatically loads and unloads them to Solr. The same way Tomcat et. al
watch for newly deployed apps and removed ones..

Lance

p.s. I started writing shell scripts in 1982. The young whippersnappers in
the office are in awe of my MAD SHELL SKILLZ

-----Original Message-----
From: news [mailto:[hidden email]] On Behalf Of Jon Drukman
Sent: Tuesday, August 12, 2008 5:50 PM
To: [hidden email]
Subject: Administrative questions

1. How do people deal with having solr start when system reboots, manage the
log output, etc.  Right now I run it manually under a unix 'screen'
command with a wrapper script that takes care of restarts when it crashes.
That means that only my user can connect to it, and it can't happen when the
system starts up... But I don't see any other way to control the process
easily.

2. Is there any way to modify a schema without stopping the process,
destroying the existing index, then restarting and reloading all the data?
It doesn't take that long and we're not in production yet, but once we're
live I can't see that being feasible.

-jsd-


Reply | Threaded
Open this post in threaded view
|

Re: Administrative questions

Jeremy Hinegardner
In reply to this post by Jon Drukman
On Tue, Aug 12, 2008 at 05:49:32PM -0700, Jon Drukman wrote:
> 1. How do people deal with having solr start when system reboots, manage
> the log output, etc.  Right now I run it manually under a unix 'screen'
> command with a wrapper script that takes care of restarts when it crashes.  
> That means that only my user can connect to it, and it can't happen when
> the system starts up... But I don't see any other way to control the
> process easily.

We use a standalone jetty instance for our solr war, and I have that controlled
with an init.d script for start/stop/restart.  I'm actually packing our solr
server as an rpm with a customized jetty config, the solr war, the solr
configuration all the solr/bin scripts and an init.d script and deploying it to
servers that way.

I'd be happy to donate the enhanced jetty configuration (jmx and such), along
with the init.d script to the community if anyone wants it as part of the
example application.

Or if people are interested in the rpm spec I can make that available as well.

enjoy,

-jeremy

--
========================================================================
 Jeremy Hinegardner                              [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Administrative questions

vikalp sahni
In reply to this post by Jon Drukman
We host solr on TOMCAT.
To tackle reboot. We start solr by starting Tomcat in init and using a small
script (called by the tomcat rc.d script)
kept at the  "../SOLRHOME" which does the CHDIR and starts catalina. This
works perfectly for multiple indexes
hosting too.

//Vikalp

On Wed, Aug 13, 2008 at 11:22 PM, Jon Drukman <[hidden email]> wrote:

> Jason Rennie wrote:
>
>> On Tue, Aug 12, 2008 at 8:49 PM, Jon Drukman <[hidden email]> wrote:
>>
>>  1. How do people deal with having solr start when system reboots, manage
>>> the log output, etc.  Right now I run it manually under a unix 'screen'
>>> command with a wrapper script that takes care of restarts when it
>>> crashes.
>>>  That means that only my user can connect to it, and it can't happen when
>>> the system starts up... But I don't see any other way to control the
>>> process
>>> easily.
>>>
>>>
>> We use daemontools.  Restarts solr whenever it goes down (for whatever
>> reason) and directs output to a set of rotated log files.  Very handy for
>> a
>> production environment.  A bit tricky to set, but solid once you have it
>> in
>> place.
>>
>> http://cr.yp.to/daemontools.html
>>
>
> *facepalm*
>
> Duh.  I should have thought of that.  I'm a big fan of djbdns so I'm quite
> familiar with daemontools.
>
> Thanks!
>
> -jsd-
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Administrative questions

Jason Rennie-2
In reply to this post by Jon Drukman
On Wed, Aug 13, 2008 at 1:52 PM, Jon Drukman <[hidden email]> wrote:

> Duh.  I should have thought of that.  I'm a big fan of djbdns so I'm quite
> familiar with daemontools.
>
> Thanks!
>

:)  My pleasure.  Was nice to hear recently that DJB is moving toward more
flexible licensing terms.  For anyone unfamiliar w/ daemontools, here's
DJB's explanation of why they rock compared to inittab, ttys, init.d, and
rc.local:

http://cr.yp.to/daemontools/faq/create.html#why

Jason
Reply | Threaded
Open this post in threaded view
|

Re: Administrative questions

Otis Gospodnetic-2
In reply to this post by Jon Drukman
Jeremy, +1 for the jmx config.... or at least putting that into on the SolrJMX page.


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----

> From: Jeremy Hinegardner <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, August 13, 2008 8:12:33 PM
> Subject: Re: Administrative questions
>
> On Tue, Aug 12, 2008 at 05:49:32PM -0700, Jon Drukman wrote:
> > 1. How do people deal with having solr start when system reboots, manage
> > the log output, etc.  Right now I run it manually under a unix 'screen'
> > command with a wrapper script that takes care of restarts when it crashes.  
> > That means that only my user can connect to it, and it can't happen when
> > the system starts up... But I don't see any other way to control the
> > process easily.
>
> We use a standalone jetty instance for our solr war, and I have that controlled
> with an init.d script for start/stop/restart.  I'm actually packing our solr
> server as an rpm with a customized jetty config, the solr war, the solr
> configuration all the solr/bin scripts and an init.d script and deploying it to
> servers that way.
>
> I'd be happy to donate the enhanced jetty configuration (jmx and such), along
> with the init.d script to the community if anyone wants it as part of the
> example application.
>
> Or if people are interested in the rpm spec I can make that available as well.
>
> enjoy,
>
> -jeremy
>
> --
> ========================================================================
> Jeremy Hinegardner                              [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Administrative questions

Jon Drukman
In reply to this post by Jason Rennie-2
Jason Rennie wrote:

> On Wed, Aug 13, 2008 at 1:52 PM, Jon Drukman <[hidden email]> wrote:
>
>> Duh.  I should have thought of that.  I'm a big fan of djbdns so I'm quite
>> familiar with daemontools.
>>
>> Thanks!
>>
>
> :)  My pleasure.  Was nice to hear recently that DJB is moving toward more
> flexible licensing terms.  For anyone unfamiliar w/ daemontools, here's
> DJB's explanation of why they rock compared to inittab, ttys, init.d, and
> rc.local:
>
> http://cr.yp.to/daemontools/faq/create.html#why

in case anybody wants to know, here's how to run solr under daemontools.

1. install daemontools
2. create /etc/solr
3. create a user and group called solr
4. create shell script /etc/solr/run  (edit to taste, i'm using the
default jetty that comes with solr)

#!/bin/sh
exec 2>&1
cd /usr/local/apache-solr-1.2.0/example
exec setuidgid solr java -jar start.jar


4. create /etc/solr/log/run containing:

#!/bin/sh
exec setuidgid solr multilog t ./main

5. ln -s /etc/solr /service/solr

that is all.  as long as you've got svscan set to launch when the system
boots, solr will run and auto-restart on crashes.  logs will be in
/service/solr/log/main (auto-rotated).

yay.
-jsd-

Reply | Threaded
Open this post in threaded view
|

Re: Administrative questions

Otis Gospodnetic-2
In reply to this post by Jon Drukman
Thanks!
I put that up on http://wiki.apache.org/solr/Daemontools , so if you want to add/change anything, you can do so at any time (anyone can edit or create wiki pages).

 Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----

> From: Jon Drukman <[hidden email]>
> To: [hidden email]
> Sent: Friday, August 15, 2008 4:47:27 PM
> Subject: Re: Administrative questions
>
> Jason Rennie wrote:
> > On Wed, Aug 13, 2008 at 1:52 PM, Jon Drukman wrote:
> >
> >> Duh.  I should have thought of that.  I'm a big fan of djbdns so I'm quite
> >> familiar with daemontools.
> >>
> >> Thanks!
> >>
> >
> > :)  My pleasure.  Was nice to hear recently that DJB is moving toward more
> > flexible licensing terms.  For anyone unfamiliar w/ daemontools, here's
> > DJB's explanation of why they rock compared to inittab, ttys, init.d, and
> > rc.local:
> >
> > http://cr.yp.to/daemontools/faq/create.html#why
>
> in case anybody wants to know, here's how to run solr under daemontools.
>
> 1. install daemontools
> 2. create /etc/solr
> 3. create a user and group called solr
> 4. create shell script /etc/solr/run  (edit to taste, i'm using the
> default jetty that comes with solr)
>
> #!/bin/sh
> exec 2>&1
> cd /usr/local/apache-solr-1.2.0/example
> exec setuidgid solr java -jar start.jar
>
>
> 4. create /etc/solr/log/run containing:
>
> #!/bin/sh
> exec setuidgid solr multilog t ./main
>
> 5. ln -s /etc/solr /service/solr
>
> that is all.  as long as you've got svscan set to launch when the system
> boots, solr will run and auto-restart on crashes.  logs will be in
> /service/solr/log/main (auto-rotated).
>
> yay.
> -jsd-