No alive nodes found in your cluster

Hi,

I'm using elasticsearch 5.2.2 with Laravel 5.4 and homestead and I get the following error when I browse http://pr3.app:8000

NoNodesAvailableException in StaticNoPingConnectionPool.php line 51:
No alive nodes found in your cluster

All reaserch on this error led me to this advice from Zachary Tong.

It is advised to correct the certificate. But why do I need it if I'm accessing ES using http only?
Plus it is really not clear how I can set a different self-signed certificate from than the one that came with curl.

Configuration

  • platform : win10.

  • curl version 7.53.1

  • In composer.json, I've added to the require list "elasticsearch/elasticsearch": "~5.0".

  • Then I run the command composer update.

  • To test Elasticsearch, I've written the following in routes/web.php

      Route::get('/', function () {
          $es = Elasticsearch\ClientBuilder::create()
              ->setHosts(['pr3.app:9200'])
              ->build();
          
          $indexed = $es->index([
              'index' => 'people',
              'type' => 'persons',
              'body' => [
                  'firstName' => 'John',
                  'lastName' => 'Doe',
                  'gender' => 'male',
              ],
          ]);
      });
    
  • using a browser, curl or postman, http://pr3.app:9200 always return:
    {
    "name": "FAkNvtq",
    "cluster_name": "elasticsearch",
    "cluster_uuid": "M5pNi9p0TF2udk7DNwcFZQ",
    "version": {
    "number": "5.2.2",
    "build_hash": "f9d9b74",
    "build_date": "2017-02-24T17:26:45.835Z",
    "build_snapshot": false,
    "lucene_version": "6.4.1"
    },
    "tagline": "You Know, for Search"
    }

  • I am able to index/search documents using postman, but not with php so far.

  • when I try curl https://pr3.app:9200
    curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

What am I missing in my config?

I've used laragon instead of homestead and wamp.

Sorry for not getting to your question earlier, this last week has been the Elasticon conference and so essentially all of Elasticsearch engineering has been relatively unavailable.

For the record and future readers, the "No Nodes Available" exception simply means that it cannot find your cluster. Sometimes it's related to certificates (as in your case), but often it is just a connectivity issue: wrong port, cluster isn't online, SELinux is firewalling, etc.

Hi Zachary,

Thank you for your response.

All the best :smiley:

Np! Fwiw, if you have future problems feel free to open an issue at the ES-PHP github repo, I tend to see those faster than on the forums :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.