【问题标题】:running sphinx in two different apps on the same server在同一服务器上的两个不同应用程序中运行 sphinx
【发布时间】:2012-04-12 09:56:49
【问题描述】:

我有两个包含搜索功能的小应用程序。它们完全是两个不同的应用程序,具有不同的数据库等。

现在问题出现在 pid 文件上。有时只有在应用程序上搜索原因时才这样做

rake ts:start 

其中一个表示另一个实例已经在运行。 如何更改此设置,以便 sphinx 继续为这两个应用程序运行。我正在使用 Capistrano 进行开发。

结构是这样的:

  /home/me/my_app_1/production/current
  /home/me/my_app_2/production/current

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 sphinx thinking-sphinx


    【解决方案1】:

    在这两个应用程序中,您必须创建一个config/sphinx.yml,它可以包含各种配置变量,其中一个允许您指定 sphinx 服务器的端口。当您像这样在一个应用程序中手动定义端口时:

    development:
      port: 9313
    test:
      port: 9314
    production:
      port: 9316
    

    在另一个方面:

    development:
      port: 9317
    test:
      port: 9318
    production:
      port: 9319
    

    然后在两个应用程序中调用rake ts:rebuild。 Thinking sphinx 将为 sphinx 生成新的配置文件,为每个应用程序和应用程序中的每个环境设置不同的 sphinx 实例。

    【讨论】:

      猜你喜欢
      • 2019-08-03
      • 2011-11-21
      • 1970-01-01
      • 2020-01-20
      • 2021-03-02
      • 2019-01-21
      • 2021-03-02
      • 2019-01-26
      • 1970-01-01
      相关资源
      最近更新 更多