Connection Refused Using Sunspot and Solr in Rails

Connection refused using Sunspot and Solr in Rails

Turns out it was a bug in Sunspot. Here's a link to the issue I filed for a full description:

https://github.com/sunspot/sunspot/issues/262

My workaround was to edit the .yml file and change all ports (test, development, and production) to 8983.

Ruby on Rails - Solr/Sunspot: Connection refused - connect(2)

It turns out that in the end, after all the troubleshooting, the problem was just the port number in the config file (in some drawn out way) -- i.e. Sunspot.config.solr.url.

rails RSolr::Error::ConnectionRefused: Connection refused error

I've forgot to run the command

rake sunspot:solr:run

Hope that helps someone new with sunspot/solr such as myself

Rails - Solr production server, connection refused

Most probably, your Solr is not set up to listen to the localhost interface and only listens to mydomain.com interface.

To verify this assumption, do curl localhost:8983/solr/solr_sunspot_example and curl mydomain.com:8983/solr/solr_sunspot_example from your instance. If the second command succeeds, while the first one does not that would be the case.

You would have 2 options to solve it: either point your configuration to query the mydomain.com interface, or change Solr configuration to listen on the localhost interface. The later will be controlled by the hostname setting in the sunspot.yml (see the github wiki page you're referencing above).



Related Topics



Leave a reply



Submit