sphinxsearch 返回“无法发送客户端协议版本”

发布于 2024-08-19 23:55:50 字数 745 浏览 4 评论 0原文

在我的一些服务器上,执行 sphinx php 查询会返回该错误。搜索谷歌我找不到任何东西,除了这是错误出现的部分原因:

// send my version
    // this is a subtle part. we must do it before (!) reading back from searchd.
    // because otherwise under some conditions (reported on FreeBSD for instance)
    // TCP stack could throttle write-write-read pattern because of Nagle.
    if (!$this->Send($fp, pack('N', 1), 4))
    {
      fclose($fp);
      $this->error = 'failed to send client protocol version';
      return false;
    }

我发现的关闭是这个 http://www.sphinxsearch.com/forum/view.html?id=4919

但我不知道 sphinxapi.php 在哪里(我使用手动编译安装)并且不确定这是否是一个好主意。

有人有什么想法吗?

On some of my servers, doing a sphinx php query returns that error. Searching google I can't find anything except this is part of why the error came out:

// send my version
    // this is a subtle part. we must do it before (!) reading back from searchd.
    // because otherwise under some conditions (reported on FreeBSD for instance)
    // TCP stack could throttle write-write-read pattern because of Nagle.
    if (!$this->Send($fp, pack('N', 1), 4))
    {
      fclose($fp);
      $this->error = 'failed to send client protocol version';
      return false;
    }

The close I've found is this http://www.sphinxsearch.com/forum/view.html?id=4919

But I do not know where the sphinxapi.php is (I installed using manual compile) and not sure if that's a good idea.

Anyone has any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

嗼ふ静 2024-08-26 23:55:50

我的服务器上刚刚遇到了同样的问题,我意识到我根本没有启动 searchd 守护进程。

希望这有帮助

I just had the same issue on my server, and I realized I did not start the searchd daemon at all.

Hope this helps

风为裳 2024-08-26 23:55:50

首先请确保您为 api 库使用合适的 IP。
中查看正在使用的 ip

您可以在sphinx.config 部分 searchd{}

。如果没问题,下一步是查看 sphinx 状态

searchd --status

First of all make shure that you use suitable ip for api library.
What ip is using you can see into

sphinx.config section searchd{}.

If it is ok next step is to see sphinx status

searchd --status

滥情哥ㄟ 2024-08-26 23:55:50

问题可能出在错误的端口上。我在 sphinx.config 中设置了两个端口用于监听:

searchd{
   listen = 9312
   listen = 9306:mysql41
}

当我尝试通过 9306 端口进行连接时,出现了上述错误。将其更改为 9312 解决了问题。

The issue can be with the wrong port. I had two ports set for listening in my sphinx.config:

searchd{
   listen = 9312
   listen = 9306:mysql41
}

When I've tried to connect via 9306 port, I got the error mentioned above. Changing it to 9312 solved the problem.

情话墙 2024-08-26 23:55:50

我对 Sphinx 2.2.8 也有同样的问题,

我发现在这个版本中,searchd 配置中的侦听端口集已被删除,现在端口是

listening on all interfaces, port=9312
listening on all interfaces, port=9306

所以当您配置 sphinx 客户端时,使用端口 9312 对我有用。即:

$sphinxClient = new SphinxClient()
$sphinxClient->SetServer("localhost", 9312);

希望这对您有帮助。如果您需要有关基本配置的更多详细信息,请询问我。

I have the same problem with Sphinx 2.2.8

What I found is in this version the set of listen port in searchd configuration was removed and now the ports are

listening on all interfaces, port=9312
listening on all interfaces, port=9306

So when you configure the sphinx client use port 9312 works for me. Ie:

$sphinxClient = new SphinxClient()
$sphinxClient->SetServer("localhost", 9312);

Hope this helps you. And if you need more details about the basic configuration just ask me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文