Py学习  »  Elasticsearch

对elasticsearch服务器的Httpoison请求提供了一个EconRefused错误,而对同一个对象进行卷曲则不会

Paul Rousseau • 4 年前 • 210 次点击  

当我试图使用httpoison查询elasticsearch服务器时

iex(1)> HTTPoison.get "http://localhost:9200"

{:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}.

如果我做了

curl -XGET "http://localhost:9200"

我明白了

{
  "name" : "es01",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "Wik-EpMkQ8ummJE6ctNAOg",
  "version" : {
    "number" : "7.0.1",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "e4efcb5",
    "build_date" : "2019-04-29T12:56:03.145736Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.7.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

P、 S.:将localhost更改为127.0.0.1并不能解决这个问题。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/53419
 
210 次点击  
文章 [ 1 ]  |  最新文章 4 年前