Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ThnkingSphinx (sphinxd) on remote database server with delta indexes?

I'm working on setting up a simple multi-tier Rails 3.1 setup -- web apps on one or more servers, postgresql database and our Sphinx search indexes on a remote server.

On a single-server setup we're using ThinkingSphinx, and delta indexes (using delayed_job), then a nightly cron to update the main index. Works great.

So: user creates indexable content; app tells delayed_job to schedule an update; delta-indexer adds new content to delta-index; searches look at both to resolve the search query properly; nightly job recreates single main index.

The documentation for ThinkingSphinx says here near the bottom

The best approach is to have Sphinx, the database and the delayed job processing task all running on one machine.

But I am unclear how to send the information needed by the delayed job process to the single server to be run. I have read some stuff about having a shared file system (yuck -- really?). I haven't read the code yet, but maybe there's a simple way?

Here's hoping!

like image 755
Tom Harrison Avatar asked Oct 09 '22 07:10

Tom Harrison


1 Answers

The delayed job worker (running on your DB/Sphinx server) references the database, within the context of your Rails app - so you'll need the app on your DB/Sphinx server as well, but just to run the DJ worker.

From the perspective of your app servers, TS will just add job records to the database as per normal.

You'll also want to set the following settings - this one goes at the end of your config/application.rb:

ThinkingSphinx.remote_sphinx = Rails.env.production?

And add the Sphinx version to your config/sphinx.yml:

production:
  version: 2.0.1-beta
like image 71
pat Avatar answered Oct 11 '22 20:10

pat