【问题标题】:ThinkingSphinx::ConnectionError asynchronous connectionThinkingSphinx::ConnectionError 异步连接
【发布时间】:2015-08-06 15:12:02
【问题描述】:

我的 Rails 项目在服务器 nginx + 乘客上运行。我注意到思考狮身人面像无法响应异步连接。我在浏览器搜索查询的两个选项卡中运行,其中一个响应返回了此错误:

Error connecting to Sphinx via the MySQL protocol. Error connecting to Sphinx via the MySQL protocol. Can't connect to MySQL server on '127.0.0.1' (111) ...

thinking_sphinx.yml:

development:
  quiet_deltas: true
  mysql41: 9311
  bin_path: "/usr/bin"  
  searchd_binary_name: searchd
  indexer_binary_name: indexer
  min_infix_len: 3
  min_word_len: 2
  html_strip: 1
  index_exact_words: 1
  min_stemming_len: 4
  charset_type: "utf-8"
test:
  mysql41: 9311
production:
  mysql41: 9311

本地主机上没有这样的问题,WebRick 上的服务器。 我该怎么做才能避免这种情况。只有一个思维斯芬克斯过程。也许我可以增加它的数量。 提前致谢!

更新

我重建了会思考的狮身人面像,我好久没做了,现在它没有掉下来,也许里面有东西。但是我还是对如何运行多个ts进程感兴趣,还是没必要。

【问题讨论】:

标签: ruby-on-rails nginx passenger sphinx thinking-sphinx


【解决方案1】:

通过帮助files:

您可以在一台机器上运行任意数量的 Sphinx 实例 - 但每个实例都必须绑定到不同的端口。您可以通过 config/thinking_sphinx.yml 文件执行此操作 - 只需使用 mysql41 设置(或 v3 之前的端口)为特定环境添加端口设置:

staging:
  mysql41: 9313

【讨论】:

  • 我听不懂。我应该写成:mysql41:9311,mysql41:9312,mysql41:9313还是开发:mysql41:9311,开发:mysql41:9312,开发:mysql41:9313
  • 然后,我应该重建还是重启就足够了?
  • 不,您不应该有多个 searchd 进程。特别是在相同的索引上运行。 - 如果要运行多个 TS 实例 - 因为每个实例都需要完全独立的 searchd 运行。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-27
  • 1970-01-01
  • 2021-12-17
  • 1970-01-01
  • 2023-04-08
  • 2018-08-17
相关资源
最近更新 更多