Closed (fixed)
Project:
Sphinx Search
Version:
5.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2008 at 20:00 UTC
Updated:
10 Dec 2010 at 15:22 UTC
I am not able to figure out how to perform logrotate. Where should the spinx-logrotate file need to reside? What exact linux command need to be issued? I tried
sphinx --rotate main
but that doesn't work.
Otherwise, the sphinxsearch is working great for my site. You can even use my site (www.pico-car.com) as demo site for the search.
Comments
Comment #1
VinayKAgarwal commentedActually I just realized that these are two separate questions
1. how to rotate index
2. how to rotate log
I need help with both. :-)
Comment #2
VinayKAgarwal commentedIt seems the script (to index) already has --rotate option in it - is there anything else needed to be done?
Comment #3
markus_petrux commented--rotate is an optional argument for the Sphinx indexer command. It is necessary if indexer command is executed when the searchd daemon is running.
The provided script
docs/contrib/sphinxcontains examples on how to do this.The file
docs/contrib/sphinx-logrotateis just an example. It needs to be adjusted for your particular configuration. Here's the contents of the sample provided:You may change all logrotate options or leave them as-is, except the path to your sphinx start/stop script.
Once this is done, you should adjust the logrotate configuration in your system so this snippet can be executed.
If directory
/etc/logrotate.dexists, then just copy your adjusted version of the filedocs/contrib/sphinx-logrotate.If directory
/etc/logrotate.ddoes not exist, then try to find the file/etc/logrotate.conf.I'm not sure if logrotate is configured the same way in all linux distros out there, so you may try "
man logrotate" from your linux console if the above indications don't apply in your linux box.Comment #4
VinayKAgarwal commentedThanks - this clarified everything :-)
Comment #5
markus_petrux commentedYou're welcome. :-)
Sweet. I would appreciate if you could open a separate issue describing how you're using Sphinx search, number of nodes, time your indexer processes take to rebuild indexes, or something of that sort. Not too much info, just a little, so other users might find something useful there. I would then link to your site and to that issue from the project page. :-)
Comment #6
markus_petrux commentedComment #7
markus_petrux commentedComment #8
Kai commentedI suggest to also add
otherwise sphinx get restarted for each *.log file found in /usr/local/sphinx/var/log/
Anyway may be this one is a better way to rotate the logs since sphinx doesn't need to be restarted.