Thursday, January 6, 2011

Getting searchd to run in Sphinx

Yesterday I tried to run searchd in Sphinx. To run searchd you use the ./searchd command and give it a path to your sphinx.conf file.

On the command line I wrote:

./searchd --config=/directory/to/config/file/sphinx.conf

The result was a message that looked very much like this.

using config file '/sphinx/conf/sphinx.conf'...
listening on all interfaces, port=9312
bind() failed on 0.0.0.0, retrying...
bind() failed on 0.0.0.0, retrying...
bind() failed on 0.0.0.0, retrying...
bind() failed on 0.0.0.0, retrying...
bind() failed on 0.0.0.0, retrying...
bind() failed on 0.0.0.0, retrying...


A fatal error ensued. This morning after a second consult of the Sphinx forum, the problem was clarified. The Sphinx searchd program cannot be activated using the --config=// syntax. The correct syntax is ./searchd -c /path/to/conf/file/sphinx.conf

Once I wrote:

./searchd -c /directory/to/config/file/sphinx.conf

It worked.

In Sphinx the correct syntax for starting the search daemon differs from the correct syntax for running the indexer.

In the case of the indexer you use the --config=// syntax.

In the case of searchd you use -c // syntax.

Not sure why Sphinx was designed this way.

No comments: