I'm using the Tire gem in Ruby on Rails to use Elasticsearch for searching. On my local machine it works great.
On my staging server I (randomly?) get this error:
SocketError (getaddrinfo: Name or service not known)
Sometimes it works great and is very fast, and sometimes it just throws that error.
Elasticsearch is running on the same server and the url it uses is:
http://localhost:9200
I have this in my hosts file:
127.0.0.1 staging-server.mydomain.com staging-server
Where subdomain and domain are set correctly.
What could be the cause of the errors and why does it only happen sometimes?
I had to add
127.0.0.1 localhost
to my hosts file...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With