title: Cannot connect to elastic search : no active connection found: no Elasticsearch node available
body: <p>I just cannot understand what is happening. My go application is unable to connect to elastic search. The node is available, is up and running. What am I doing wrong here?</p>
  
  <pre><code>import (
      "fmt"
      "github.com/olivere/elastic/v7"
      "github.com/sirupsen/logrus"
      "gitlab.com/codereverie/anuvadak-api-server/app_config"
      "gopkg.in/sohlich/elogrus.v7"
      "gopkg.in/validator.v2"
      "io"
      "os"
  )
  
  eurl := "http://ip:port"
  eUsername := "username"
  ePassword := "password"
  
  client, err := elastic.NewClient(elastic.SetURL(eurl), elastic.SetBasicAuth(eUsername, ePassword))
  
  if err != nil {
      fmt.Println("Some error", err.Error())
      panic("Failed to initialize elastic-search client")
  }
  </code></pre>
  
  <p>What is incorrect here? The error says <code>no active connection found: no Elasticsearch node available</code></p>
  
  <p>Here is the data returned from elastic search when I hit the GET request in browser</p>
  
  <pre><code>  {
  "name": "ABC-1",
  "cluster_name": "ABC",
  "cluster_uuid": "3oo05v6lSSmE7DpRh_68Yg",
  "version": {
    "number": "7.6.2",
    "build_flavor": "default",
    "build_type": "deb",
    "build_hash": "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
    "build_date": "2020-03-26T06:34:37.794943Z",
    "build_snapshot": false,
    "lucene_version": "8.4.0",
    "minimum_wire_compatibility_version": "6.8.0",
    "minimum_index_compatibility_version": "6.0.0-beta1"
  },
  "tagline": "You Know, for Search"
  </code></pre>
  
  <p>}</p>