Skip to content
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.

Tire in Production Mode gives me "Errno::ECONNREFUSED (Connection refused - connect(2))" #180

Closed
schneider-th opened this issue Dec 22, 2011 · 2 comments

Comments

@schneider-th
Copy link

Hi,

I have an Ubuntu 10.04 VPS running with ElasticSearch on it. The service gives me an PID when startet so I guess that everything is OK.

On the other hand if I run ES with Tire on my local machine in development mode everything works fine too. But after deploying it breaks the models which support searching. This results in objects not getting saved and and the search not being able to perform. Instead my rails log says, when I try to search:

Started GET "/tagebuch?utf8=%E2%9C%93&query=batman" for 212.202.114.178 at 2011-12-22 16:43:07 +0100
Processing by PostsController#index as HTML
Parameters: {"utf8"=>"✓", "query"=>"batman"}
Completed 500 Internal Server Error in 11ms

Errno::ECONNREFUSED (Connection refused - connect(2)):
app/models/post.rb:23:in search' app/controllers/posts_controller.rb:12:inindex'

If I want to create a new object it's the same, only with the @object.save line in my controller being shown as source of the error.

As I couldn't find anything I'm wondering if there is any special setup needed so that Tire can communicate with ES.

I'm also running Nginx, if that got anything to do with it.

Thanks in regards.

@karmi
Copy link
Owner

karmi commented Dec 23, 2011

The error says Tire is not able connect to Elasticsearch. I suppose you run everything with default configurations? What do you see when you issue curl http://localhost:9200 on said machine?

@schneider-th
Copy link
Author

OK, I figured it out. After installing ES on my VPS I set it up according to the guide and configured my IP address, of the VPS. After removing the line and letting ES search for it automatically, the app finally works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants