elasticsearch - NoNodesAvailableException in StaticNoPingConnectionPool.php : No alive nodes found in your cluster -


i use elasticsearch v 5.5.2 laravel 5.3 - scout v -2.0.

i trying executing below code getting error. nonodesavailableexception.

namespace app\http\controllers;  use illuminate\http\request; use elasticsearch\clientbuilder; use elastica\client elasticaclient;  class clientcontroller extends controller {     protected $elasticsearch;     protected $elastica;     public function __construct()     {         $this->elasticsearch = clientbuilder::create()                 //->setconnectionpool('\elasticsearch\connectionpool\sniffingconnectionpool', [])                 ->build();         $elasticconfig=['host'=>"locahost",             "port"=>9200,             "index"=>'pets'];         $this->elastica = new  elasticaclient($elasticconfig);     }     public function elasticsearchtest(){          $param = [             'index' => 'pets',             'type' => 'dog',             'id'=>'1'         ];         $res = $this->elasticsearch->get($param);         dump($res);      } } 

error

nonodesavailableexception in staticnopingconnectionpool.php line 51: no alive nodes found in cluster

it's working fine in sense. result:

{    "_index": "pets",    "_type": "dog",    "_id": "1",    "_version": 1,    "found": true,    "_source": {       "name": "tommy",       "age": "3",       "color": "black",       "gender": "male"    } } 

also working on http://localhost:9200/pets/dog/1. result:

{"_index":"pets","_type":"dog","_id":"1","_version":1,"found":true,"_source":{     "name":"tommy",     "age":"3",     "color":"black",     "gender":"male" } }  


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -