如何运行多个sphinx实例?

发布于 2024-11-06 22:55:15 字数 530 浏览 0 评论 0原文

我有一个运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

同展鸳鸯锦 2024-11-13 22:55:15

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 :)

落在眉间の轻吻 2024-11-13 22:55:15

唯一的问题是 sphinx 只允许你使用一个配置文件“sphinx.conf”

不,您可以根据需要使用它们。

如何运行 searchd 的第二个实例以便使用 sphinx-vb.conf 文件?我需要 2 运行的原因是我对索引有不同的需求,并且有 cron 作业等等,这会让事情变得更容易。

不确定您是否需要另一个实例来满足您的需求。我的意思是运行 sphinx-vb.conf 文件。就像不同实例的替代方案一样,您可以在 sphinx-vb.conf 文件中创建不同的源,并使用同一实例运行两个配置索引,例如:

1 * * * * indexer --config /etc/sphinxsearch/sphinx.conf --all --rotate
* 2 * * * indexer --config /etc/sphinxsearch/sphinx-vb.conf --all --rotate

然后在具有相同连接的同一端口上运行它,但对不同源进行查询。例如,使用sphinxapi.php

$sphinx->SetServer( "localhost", 9312 );
$result1 = $sphinx->Query('','firstSource');
...
$result1 = $sphinx->Query('','sourceVb');

The only problem is sphinx only allows you to use one config file "sphinx.conf"

No, you can use them as much as you need.

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.

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:

1 * * * * indexer --config /etc/sphinxsearch/sphinx.conf --all --rotate
* 2 * * * indexer --config /etc/sphinxsearch/sphinx-vb.conf --all --rotate

then run it on same port with same connect but make Queries for different sources. For example, with using sphinxapi.php:

$sphinx->SetServer( "localhost", 9312 );
$result1 = $sphinx->Query('','firstSource');
...
$result1 = $sphinx->Query('','sourceVb');
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文