Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NoNodeAvailableException: No alive nodes. All the 1 nodes seem to be down #246

Closed
hazratmilad opened this issue Apr 14, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@hazratmilad
Copy link

Describe the bug

node is alive and i can access by curl :
curl --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic https://localhost:9200

but with api call :

NoNodeAvailableException: No alive nodes. All the 1 nodes seem to be down. in file /var/www/html/vendor/elastic/transport/src/NodePool/SimpleNodePool.php on line 77

Additional context

SCOUT_DRIVER=Matchish\ScoutElasticSearch\Engines\ElasticSearchEngine
ELASTICSEARCH_HOST=https://localhost:9200
ELASTICSEARCH_USER=elastic
ELASTICSEARCH_PASSWORD=O8loD2Uvy4-XDL-CIl2P

Version

Versions of Laravel 10, Scout 10, and the package 7.2.1.

@hazratmilad hazratmilad added the bug Something isn't working label Apr 14, 2023
@matchish
Copy link
Owner

The package use official elasticsearch client

$clientBuilder = ClientBuilder::create()->setHosts(Config::hosts());

I believe if you will instantiate the client by yourself you'll get the same error. Usually people have the issue because of wrong configuration

@matchish matchish changed the title [BUG] [BUG] NoNodeAvailableException: No alive nodes. All the 1 nodes seem to be down Apr 17, 2023
@matchish
Copy link
Owner

If you have some specific requirements to configuration you can implement your own
ElasticSearchServiceProvider and register it
https://github.com/matchish/laravel-scout-elasticsearch#rocket-installation

'providers' => [
    // Other Service Providers

    \Matchish\ScoutElasticSearch\ElasticSearchServiceProvider::class
],

@matchish matchish closed this as completed Jun 6, 2023
@kbiro-nander
Copy link

@hazratmilad the problem is that you probably did not provide the SSL certificate of your Elastic instance.

You can run the Elastic image without the SSL certificate with the following options:

xpack.security.enabled=false
discovery.type=single-node

docker run --name es01 --net elastic -p 9200:9200 -it -e "xpack.security.enabled=false" -e "discovery.type=single-node" -m 1GB docker.elastic.co/elasticsearch/elasticsearch:8.10.4

Do this only in your local environment!

Alternatively you can add the certificate to the laravel-scout-elasticsearch config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants