我正在尝试使用 Bonsai 插件在 Heorku 上运行 Elasticsearch,但我不断收到以下错误:
Faraday::ConnectionFailed (Connection refused - connect(2)):
然后有时也会这样
Completed 500 Internal Server Error in 131ms (Searchkick: 5.7ms | ActiveRecord: 11.1ms)
Faraday::ConnectionFailed (Connection refused - connect(2)):
我听说这是因为它找不到 Bonsai URL,但我相信我是用 /config/initializer/bonsai.rb 启动的
Elasticsearch::Model.client = Elasticsearch::Client.new url: ENV['BONSAI_URL']
有任何想法吗?基本上整个应用程序已经停止工作。它在本地运行良好,这只是在生产中。
我也gem 'bonsai-elasticsearch-rails', '~> 0.0.4'
安装了,但还是不行。
我也去重新建立了索引,根据这个,仍然是同样的错误
rs191919:~/workspace/sample_app (bonsai-more-more) $ curl -XPOST [MYURL]/pallet-index
{"acknowledged":true}
rs191919:~/workspace/sample_app (bonsai-more-more) $ curl -XPOST [MYURL]/hello -d '{"title":"Hello world"}'
{"_index":"pallet-index","_type":"test","_id":"hello","_version":1,"created":true}
rs191919:~/workspace/sample_app (bonsai-more-more) $ curl -XGET '[MYURL]/pallet-index/te
{"_index":"pallet-index","_type":"test","_id":"hello","_version":1,"found":true,"_source":{"title":"Hello world"}}