[英]Elasticsearch SocketError (getaddrinfo: Name or service not known)
I'm using the Tire gem in Ruby on Rails to use Elasticsearch for searching. 我正在Ruby on Rails中使用Tire宝石来使用Elasticsearch进行搜索。 On my local machine it works great.
在我的本地计算机上,它运行良好。
On my staging server I (randomly?) get this error: SocketError (getaddrinfo: Name or service not known)
在我的登台服务器上(随机?),出现以下错误:
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
Elasticsearch在同一服务器上运行,其使用的URL为:
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... 到我的主机文件...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.