sohlich/elogrus

no active connection found: no Elasticsearch node available

Opened this issue · 1 comments

I'm using ELK (8) but the library returns.

no active connection found: no Elasticsearch node available

When browsing to the elasticsearch endpoint it does return a valid json response.

{
name: "elasticsearch-master-1",
cluster_name: "elasticsearch",
cluster_uuid: "ZqDoaZLyTe6O-rB6HQbscA",
version: {
number: "8.0.0-SNAPSHOT",
build_flavor: "default",
build_type: "docker",
build_hash: "747198ffed9b10273463367cf6ccc7ac5bfa077e",
build_date: "2021-02-12T18:02:06.143916Z",
build_snapshot: true,
lucene_version: "8.8.0",
minimum_wire_compatibility_version: "7.12.0",
minimum_index_compatibility_version: "7.0.0"
},
tagline: "You Know, for Search"
}

You need to set the sniff method on client like this :

elastic.NewClient(elastic.SetURL("http://localhost:9200"), elastic.SetSniff(false), elastic.SetBasicAuth("elastic", "changeme"))