我试图使用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