【问题标题】:Configuring Sunspot to work with Solr on production配置 Sunspot 以在生产环境中使用 Solr
【发布时间】:2014-06-07 04:54:50
【问题描述】:

我对这一切都比较陌生,所以如果我在这里列出的内容没有用,请随时要求澄清或更多信息!

我正在尝试将太阳黑子与 solr 一起使用,到目前为止,我一直遵循this guide 的步骤 1 和 2。

其他规格:

Ubuntu 12.04.3 LTS 宝石'导轨','4.0.2' gem 'sunspot_rails', '~> 2.1.1'

tomcat 6 和链接指南中的其他信息

数据库运行良好,tomcat 和 solr 也是如此(它们可以分别通过 :8080 和 :8080/solr url 访问)所以我怀疑我在某处弄错了一些配置。

目前我收到此错误:

RSolr::Error::Http (RSolr::Error::Http - 404 Not Found
Error: <html><head><title>Apache Tomcat/6.0.35 - Error report</title><style><!--H1   {font-family:Tahoma,A
rial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-
serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;colo
r:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;
background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.n
ame {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /solr/production
/select</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/solr/pr
oduction/select</u></p><p><b>description</b> <u>The requested resource (/solr/production/select) is not
available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.35</h3></body></html>

    Request Data: "fq=type%3AItem&start=0&rows=4&q=%2A%3A%2A"
Backtrace: /home/deploy/socialnom_production/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.10/lib/rsolr/client
.rb:283:in `adapt_response'
/home/deploy/socialnom_production/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.10/lib/rsolr/client.rb:190:in `execute'
/home/deploy/socialnom_production/shared/bundle/ruby/2.0.0/gems/rsolr-1.0.10/lib/rsolr/client.rb:176:in `send_and_receive'
etc

太阳黑子.yml:

production:
  solr:
    hostname: localhost
    port: 8983
    log_level: WARNING
    path: /solr/production


development:
  solr:
    hostname: localhost
    port: 8982
    log_level: INFO
    path: /solr/development

test:
  solr:
    hostname: localhost
    port: 8981
   log_level: WARNING
    path: /solr/test

我的应用程序中的 conf 和架构位于 /usr/share/solr/conf 和 /usr/share/conf 中,我没有触及这些

以前,在我摆弄所有东西之前,我收到了一个 ERRNO: PERMISSION DENIED 或类似的消息,如果这完全可以提供信息的话。

【问题讨论】:

    标签: ruby-on-rails solr sunspot production


    【解决方案1】:

    你的 sunspot.yml 中的端口和你的 Tomcat 使用的端口必须相同。你说你可以通过 8080 端口访问 solr 所以在你的 sunspot.yml 中:

    production:
      solr:
        hostname: localhost
        port: 8080 # This is the port of Tomcat
        log_level: WARNING
        path: /solr/production
    

    Tomcat在tomcat6用户权限下运行,所以solr/production中的data目录必须是该用户可写的。

    【讨论】:

      【解决方案2】:

      我有类似的问题。我希望我的解决方案对任何人都有帮助。

      如果你的 sunspot.yml 包含块状

      production:
        solr:
        hostname: localhost
        port: 8080 # This is the port of Tomcat
        log_level: WARNING
        path: /solr/production
      

      然后检查 sold.xml 是否包含名称为 production 的核心声明

      <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
        <core name="production" instanceDir="." dataDir="default/data"/>
        ...
      </cores>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-06-02
        • 1970-01-01
        • 1970-01-01
        • 2018-10-15
        相关资源
        最近更新 更多