我試圖使用elastic4s-http vis https連接到Elasticsearch,但無法找到使用https而不是http的方式。Elastic4s - HTTPS連接到Elasticsearch集羣
我目前使用:
HttpClient(ElasticsearchClientUri(config.getString("services.elasticsearch.host"), config.getInt("services.elasticsearch.port")))
連接到該實例。
我似乎得到一個連接,我看到這個在日誌中:
信息com.sksamuel.elastic4s.http.HttpClient $ - 上http://host:port
DEBUG com.sksamuel創建HTTP客戶端.elastic4s.http.search.SearchImplicits $ SearchHttpExecutable $ - 執行搜索請求:{「query」:{「match」:{「status」:{「query」:「Listed」}}}}
DEBUG com。 sksamuel.elastic4s.http.search.SearchImplicits $ SearchHttpExecutable $ - 執行彈性請求POST:/ myindex/_search?
DEBUG com.sksamuel.elastic4s.http.search.SearchImplicits $ SearchHttpExecutable $ - {「query」:{「match」:{「status」:{「query」:「Listed」}}}}````
但後來我得到這個:
java.io.IOException: Connection reset by peer
,並返回響應。
我如何能得到HTTPS的工作將是巨大的任何意見,感謝
有沒有辦法通過認證的用戶/密碼本的建立? – omriki
您可以在最新版本中執行'elasticsearch:// user:name @ host:port,host:port,host:port?ssl = true'。 – monkjack