Rabb-bit
Rabb-bit

Reputation: 835

NoNodesAvailableException with message 'No alive nodes found in your cluster' - Laravel 5.2 and Heroku Searchbox Add on

I have downloaded Elasticsearch into my local, I've successfully run the elasticsearch on local host. I'm currently using elasticquent on Laravel 5.2 and when I tried to switch from local host ('localhost:9200') and add an index, it prompted an error below.

Psy Shell v0.7.2 (PHP 5.5.12 ΓÇö cli) by Justin Hileman
>>> App\Products::createIndex($shards = null, $replicas = null);
Elasticsearch\Common\Exceptions\NoNodesAvailableException with message 'No alive
 nodes found in your cluster'

When i'm using the localhost, it's running fine and was able to create an index right away.

this is my config file (config\elasticquent.php)

<?php

return array(

    /*
    |--------------------------------------------------------------------------
    | Custom Elasticsearch Client Configuration
    |--------------------------------------------------------------------------
    |
    | This array will be passed to the Elasticsearch client.
    | See configuration options here:
    |
    | http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html
    */

    'config' => [
        //'hosts'     => ['http://xxx:[email protected]:9300'],
        'hosts'     => ['localhost:9200'],

        'retries'   => 1,
    ],

    /*
    |--------------------------------------------------------------------------
    | Default Index Name
    |--------------------------------------------------------------------------
    |
    | This is the index name that Elasticquent will use for all
    | Elasticquent models.
    */

    'default_index' => 'bossing_default_index',

);

I'm wondering if it has something to do with the cluster name, but can't find any document how to change the cluster name using the elasticquent.php config file. please help. thank you in advance.

My searhbox host is running fine.

and btw, this is the link to elasticquent: https://github.com/elasticquent/Elasticquent I'm currently using elasticsearch 2.3.xx

Upvotes: 0

Views: 2054

Answers (1)

Mihail J
Mihail J

Reputation: 11

You could try to use port 80 for the host, this way it works for me (just made a test account):

http://[user]:[pass]@bifur-eu-west-1.searchly.com:80

Hope this helps, Mihail

Upvotes: 1

Related Questions