2

I have a problem starting and working with sphinx. I was able to run indexer --all, but now I want to search it, and I keep getting this error when I run searchd --status.

WARNING: failed to connect to 127.0.0.1:9312: Connection refused

WARNING: failed to connect to 0.0.0.0:9306: Connection refused

FATAL: failed to connect to daemon: please specify listen with sphinx protocol in your config file

sphinx query() returns false, and I guess that's related to connection problem.

Here's the part of my .conf file.

searchd
{
    listen                  = 127.0.0.1:9312
    listen          = 9306:sphinx
    listen          = 2471:mysql41
    log         = /var/log/sphinx/searchd.log
    query_log       = /var/log/sphinx/query.log
    max_matches     = 1000
    read_timeout        = 5
    max_children        = 30
    pid_file        = /var/run/sphinx/searchd.pid
    seamless_rotate     = 1
    preopen_indexes     = 1
    unlink_old      = 1
    workers         = threads # for RT to work
    binlog_path     = /var/lib/sphinx
 }

What am I missing in configuration of listening ports?

6
  • Did you actully start searchd? Its a daemon you need to leave running (ie listening on the specific ports) - that output suggestes taht search isnt running. Sep 17, 2014 at 17:30
  • I did run sudo service sphinxsearch start, and output was sphinxsearch stop/pre-start, process 4269. I'm new to sphinx, could be that I'm missing something obvious here.
    – Ned
    Sep 17, 2014 at 17:33
  • check searchd.log - possibly it failed to actully start for some reason. Try also netstat -nlp to see if searchd is actully still running. Sep 17, 2014 at 17:39
  • yes, something is really weird. I'm missing both .log and .pid files, like these are not created at all. Looks like it didn't start at all, but I can't find other command for starting, not sure if I'm doing it the right way.
    – Ned
    Sep 17, 2014 at 17:58
  • can try starting it with literally just searchd - using the default config file etc. That might be more enlightening as it shows the startup messages directly. Sep 17, 2014 at 18:01

1 Answer 1

2

As noted in comments, indicates searchd daemon not actully running.

Can try using searchd to start the daemon (and later searchd --stop), which can show errors you might not see with using service/init.d starting.

(because if the log file itself is not functional, there is nowhere for errors to go :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.