如何运行多个sphinx实例?
我有一个运行 sphinx 的搜索引擎,现在我用 sphinx 运行我的 vbulletin 论坛。唯一的问题是 sphinx 只允许你使用一个配置文件“sphinx.conf”,而我现在有 2 个并且必须使用 2 个。所以现在我有 sphinx.conf 和 sphinx-vb.conf。如何运行 searchd 的第二个实例以便使用 sphinx-vb.conf 文件?我需要 2 运行的原因是我对索引有不同的需求,并且有 cron 作业等等,这会让事情变得更容易。我查遍了谷歌,无法弄清楚如何运行另一个 sphinx 实例。我知道我还需要在另一个端口上运行,所以我的第二个端口将比原始端口高 1,即 9313。有谁知道如何做到这一点?谢谢。
我尝试运行这个 sudo /usr/local/bin/searchd --config /usr/local/etc/sphinx-vb.conf
并收到此错误 致命:无法锁定 pid 文件“/usr/local/var/log/searchd.pid”:资源暂时不可用(searchd 已经在运行?),
但它当然正在运行。它正在为搜索引擎运行。
I have a search engine that i run sphinx with and now I run my vbulletin forum with sphinx. The only problem is sphinx only allows you to use one config file "sphinx.conf" and I now have 2 and must use 2. So now I have sphinx.conf and sphinx-vb.conf. How can I run a second instance of searchd so that I use the sphinx-vb.conf file? The reason I need 2 running is I have different needs for indexing and have cron jobs and what not and it will make things easier. I have looked all over google and cannot figure out how to run another instance of sphinx. I know I need to run on another port also so my port for the second will be 1 higher then the original which would be 9313. Does anyone know how to do this? Thanks.
I tried to run this
sudo /usr/local/bin/searchd --config /usr/local/etc/sphinx-vb.conf
and got this error
FATAL: failed to lock pid file '/usr/local/var/log/searchd.pid': Resource temporarily unavailable (searchd already running?)
but of course it is running. It is running for the search engine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Chris,正如您在问题和评论中所指出的那样 - 您需要为每个 searchd 进程使用不同的端口,和不同的 pid 文件。不同的日志文件可能也是个好主意:)
Chris, as you've noted in both your question and your comment - you need to use a different port for each searchd process, and a different pid file. Different log files may be a good idea too :)
不,您可以根据需要使用它们。
不确定您是否需要另一个实例来满足您的需求。我的意思是运行 sphinx-vb.conf 文件。就像不同实例的替代方案一样,您可以在 sphinx-vb.conf 文件中创建不同的源,并使用同一实例运行两个配置索引,例如:
然后在具有相同连接的同一端口上运行它,但对不同源进行查询。例如,使用sphinxapi.php:
No, you can use them as much as you need.
Not sure you need another instance for your needs. I mean for running sphinx-vb.conf file. Just as alternative for a different instance, you can just create different source in sphinx-vb.conf file and run both configs indexing with same instance like:
then run it on same port with same connect but make Queries for different sources. For example, with using sphinxapi.php: