A
A
alt222018-02-06 20:25:06
elasticsearch
alt22, 2018-02-06 20:25:06

Laravel 5.5 Scout + Elasticsearch "No alive nodes found in your cluster" error?

Installed laravel-scout-elastic package .
Everything according to the instructions.

// config/app.php
'providers' => [
    Laravel\Scout\ScoutServiceProvider::class,
    ScoutEngines\Elasticsearch\ElasticsearchProvider::class,
],

// config/scout.php

    'driver' => env('SCOUT_DRIVER', 'elasticsearch'),

    'elasticsearch' => [
        'index' => env('ELASTICSEARCH_INDEX', 'laravel'),
        'hosts' => [
            env('ELASTICSEARCH_HOST', 'http://localhost'),
        ],
    ],

In the model:
// App\Theme
namespace App;

use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;

class Theme extends Model
{
    use Searchable;
}

Import to search indexes:
php artisan scout:import "App\Theme"
throws an error
In StaticNoPingConnectionPool.php line 51:
  No alive nodes found in your cluster

When creating a new entry, the same error:
Elasticsearch \ Common \ Exceptions \ NoNodesAvailableException
No alive nodes found in your cluster

I've looked all over and there's nothing about it anywhere

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
InoMono, 2018-02-06
@InoMono

Check access to Elastica from another program, for example, from a console utility.
If you have access, then your connection settings in your application are not correct.
If there is no access - well, you understand.

A
Alexey Cheremisin, 2018-02-07
@leahch

env('ELASTICSEARCH_HOST', 'http://localhost:9200'),
Not?
And check if elastic is running. Can be done with curl
[email protected]:~$ curl -XGET http://localhost:9200
{
  "name" : "DR4r-FT",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "Q4TCatpdSkaMoqlezR-TQQ",
  "version" : {
    "number" : "5.1.1",
    "build_hash" : "5395e21",
    "build_date" : "2016-12-06T12:36:15.409Z",
    "build_snapshot" : false,
    "lucene_version" : "6.3.0"
  },
  "tagline" : "You Know, for Search"
}
[email protected]:~$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question