开发者

Can't connect to Sunspot server in Ubuntu server

开发者 https://www.devze.com 2023-03-15 13:08 出处:网络
I followed the steps in https://github.com/outoftime/sunspot/wiki/Adding-Sunspot-search-to-Rails-in-5-minutes-or-less to install & set up Sunspot search in Rails in a Mac OS and it is ok.

I followed the steps in https://github.com/outoftime/sunspot/wiki/Adding-Sunspot-search-to-Rails-in-5-minutes-or-less to install & set up Sunspot search in Rails in a Mac OS and it is ok.

In a Ubuntu server, there's connection refused error.

When I run

rake sunspot:solr:start

and the proccess starts. The file sunspot-solr-development.pid is created in /tmp/pids. But when I try to reindex

rake sunspot:reindex
...
rake ab开发者_高级运维orted!
Connection refused - connect(2)

I tried to run the commands with sudo and gave permission 777 to the project files, but there's still error. Rails 3.0.8.

Any ideas?


Try rake sunspot:solr:run -- this runs it in the foreground which will expose any errors happening at startup.

FWIW, I don't recommend using the bundled Solr instance in production environments, if that's what you're doing. Better to use Ubuntu's package manager or install one of the distributions provided by Solr.


Make sure soLr is running on the correct port: 8983 for production etc

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号