【问题标题】:Can't connect to Sunspot server in Ubuntu server无法连接到 Ubuntu 服务器中的 Sunspot 服务器
【发布时间】:2011-06-24 23:58:42
【问题描述】:

我按照https://github.com/outoftime/sunspot/wiki/Adding-Sunspot-search-to-Rails-in-5-minutes-or-less 中的步骤在 Mac OS 的 Rails 中安装和设置 Sunspot 搜索,一切正常。
在 Ubuntu 服务器中,出现连接被拒绝错误。
当我跑步时

rake sunspot:solr:start

然后进程开始。文件sunspot-solr-development.pid/tmp/pids 中创建。 但是当我尝试重新索引时

rake sunspot:reindex
...
rake aborted!
Connection refused - connect(2)

我尝试使用sudo 运行命令并授予项目文件777 权限,但仍然有错误。 导轨 3.0.8。

有什么想法吗?

【问题讨论】:

  • netstat -anp | grep <name of the server> 显示什么?

标签: ruby-on-rails sunspot sunspot-rails


【解决方案1】:

试试rake sunspot:solr:run——这会在前台运行它,这将暴露启动时发生的任何错误。

FWIW,如果您正在这样做,我不建议在生产环境中使用捆绑的 Solr 实例。最好使用 Ubuntu 的包管理器或安装 Solr 提供的发行版之一。

【讨论】:

【解决方案2】:

确保 soLr 在正确的端口上运行:8983 用于生产等

ubuntu@host:~/rails-project$ cat config/sunspot.yml 
production:
  solr:
    hostname: localhost
    port: 8983
    log_level: WARNING

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

bundle exec rake sunspot:solr:start RAILS_ENV=production

【讨论】:

    猜你喜欢
    • 2013-08-15
    • 2012-09-10
    • 1970-01-01
    • 2022-10-25
    • 2020-03-18
    • 2021-05-13
    • 1970-01-01
    • 2020-01-24
    • 1970-01-01
    相关资源
    最近更新 更多