ElasticSearch PHP client v2.0 keeps throwing "No alive nodes found in your cluster"

1.1k views Asked by At

The elasticSearch runs fine on my centos as a non-service. I run it as "sh bin/elasticsearch". The client I installed using composer is PHP v2.0. It just won't do anything it used to do before. I used this before and I could search, index documents, make index. Right now I cannot do anything because of this error. The strangest thing is that ElasticSearch seems to be running fine, and I can also call it with curl like:
curl localhost:9200
Please advise on the PHP API failure? I tried:
1. Opening port 9200 on my centos 6 for all
2. Used every method from the book in PHP API: search, index, delete index, etc...always get the same result and an exception is thrown in the Elasticsearch/Client class:
“No alive nodes found in your cluster”
3. Changed the owner of the directory nodes to centos, apache, elasticsearch - no use.

1

There are 1 answers

0
Vladimir Despotovic On BEST ANSWER

Resolved by installing a fresh latest tarball elasticsearch server and running it straight like this: sh bin/elasticsearch.