Issue
I have problems running sphinx search on my debian Wheezy server.
Currently, there are 2 searchd ports running
root@ns243216:~# netstat -tlpn | grep search
tcp 0 0 0.0.0.0:9306 0.0.0.0:* LISTEN 11266/searchd
tcp 0 0 0.0.0.0:9312 0.0.0.0:* LISTEN 11266/searchd
First Problem When I want to execute this
sudo /usr/bin/indexer -c /etc/sphinxsearch/sphinx.conf beta_jobs --rotate
It gives me this :
Sphinx 2.2.10-id64-release (2c212e0)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/etc/sphinxsearch/sphinx.conf'...
indexing index 'beta_jobs'...
collected 6 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, 100.0% done
sorted 0.0 Mhits, 100.0% done
total 6 docs, 867 bytes
total 0.046 sec, 18747 bytes/sec, 129.73 docs/sec
total 6 reads, 0.000 sec, 0.4 kb/call avg, 0.0 msec/call avg
total 12 writes, 0.000 sec, 0.9 kb/call avg, 0.0 msec/call avg
WARNING: failed to scanf pid from pid_file '/usr/local/sphinx/var/log/searchd/searchd.pid'.
WARNING: indices NOT rotated.
2 warnings I can't remove...
Second Problem: And when I want to stop my searchd with searchd --stop, it tells me this :
Sphinx 2.2.10-id64-release (2c212e0)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/etc/sphinxsearch/sphinx.conf'...
FATAL: stop: failed to read valid pid from '/usr/local/sphinx/var/log/searchd/searchd.pid'
I tried setting chmod 755 to everything inside /usr/local/sphinx/var/log/searchd/, still doesn't work.
My sphinx.conf is here Sphinx.conf on gist
EDIT (answer to @aeryaguzov comment)
root@ns213646:~# sudo cat /usr/local/sphinx/var/log/searchd/searchd.pid
root@ns213646:~# ps aux | grep searchd
root 11265 0.0 0.0 79692 1228 ? S Nov30 0:00 /usr/bin/searchd
root 11266 0.1 0.0 91404 4696 ? Sl Nov30 26:54 /usr/bin/searchd
root 22783 0.0 0.0 8292 632 pts/1 S+ 15:32 0:00 grep searchd
Solution
Okay it appears that for some unknown reasons the searchd.pid was badly created by searchd (which is running). So I decided to delete the search.pid and to kill
searchd. Then I re-indexed and started searchd with no problems.
Answered By - Kalzem