pat / thinking-sphinx

Sphinx/Manticore plugin for ActiveRecord/Rails
http://freelancing-gods.com/thinking-sphinx
MIT License
1.63k stars 470 forks source link

[question]: Tasks are relying on a local daemon? #1169

Closed alexanderadam closed 4 years ago

alexanderadam commented 4 years ago

Hi Pat,

so first of all: thank you for your work!

I just have a small question: So thinking sphinx supports remote daemons which is great if you want to use Sphinx in a Docker container. But it seems that most of the tasks are relying on a locally running daemon including stuff like rebuilding real-time indices (ts:rt:index).

Are such things simply not possible and/or needed when the daemon runs on another machine?

pat commented 4 years ago

Hi @alexanderadam :)

You're pretty much correct in your assumption - almost all tasks must be run locally.

The one exception, really, is ts:rt:index - because that's just sending data to an already-running Sphinx daemon. Of course, if you're running ts:rebuild, it'll call that task for you as well, but it'll also call all the other tasks. So ts:rt:index will only work if you're calling just that task remotely, and the rest locally.

Sphinx has no way to interact with the daemon state remotely - so if you do want to run remote daemons, you'll still need a copy of your Rails app on the Sphinx server/container, and for that to be able to talk to your database.

alexanderadam commented 4 years ago

Thank you @pat, for responding so fast! So what is the usual workflow for using TS with a Sphinx container? Do you have any recommendation?

pat commented 4 years ago

To be honest, I'm not entirely sure of the flow - I've not used Docker much myself, and never with Sphinx. However, others have shared their attempts and approaches in #1010 and #1131, so I'd highly recommend reading those issue threads :)

alexanderadam commented 4 years ago

Awesome, thank you and have a wonderful day!