[英]How to setup elasticsearch on Heroku?
I've implemented elasticsearch/searchkick on my app and it works on development. 我在我的应用程序上实现了elasticsearch / searchkick,它适用于开发。 My resources for the elasticsearch/searchkick implementation is GoRails and I installed elasticsearch successfully.
我的弹性搜索/ searchkick实现的资源是GoRails,我成功安装了elasticsearch。 But when I pushed it on Heroku, it gave me the error:
但当我把它推到Heroku上时,它给了我错误:
"We're sorry, but something went wrong."
“我们很抱歉,但有些不对劲。”
I did heroku logs and the errors are: 我做了heroku日志,错误是:
"Completed 500 Internal Server Error in 16ms (Searchkick: 8.0ms | ActiveRecord: 0.0ms)"
“在16ms内完成500内部服务器错误(Searchkick:8.0ms | ActiveRecord:0.0ms)”
and 和
"Faraday::ConnectionFailed (Connection refused - connect(2) for "localhost" port 9200):"
“Faraday :: ConnectionFailed(连接被拒绝 - 连接(2)for”localhost“端口9200):”
Please try this ................. 请试试这个.................
Searchkick uses ENV["ELASTICSEARCH_URL"] for the Elasticsearch server. This defaults to http://localhost:9200.
Heroku
Choose an add-on: SearchBox, Bonsai, or Elastic Cloud. 选择一个附加组件:SearchBox,Bonsai或Elastic Cloud。
# SearchBox # 搜索框
heroku addons:create searchbox:starter
heroku config:set ELASTICSEARCH_URL=`heroku config:get SEARCHBOX_URL`
# Bonsai # 盆栽
heroku addons:create bonsai
heroku config:set ELASTICSEARCH_URL=`heroku config:get BONSAI_URL`
# Found #找到了
heroku addons:create foundelasticsearch
heroku config:set ELASTICSEARCH_URL=`heroku config:get FOUNDELASTICSEARCH_URL`
Then deploy and reindex: 然后部署并重新索引:
heroku run rake searchkick:reindex CLASS=Product
Please refer this documentation https://github.com/ankane/searchkick#deployment for more information. 有关更多信息,请参阅此文档https://github.com/ankane/searchkick#deployment 。 Hope this will work for you.
希望这对你有用。 Thanks!
谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.