Hi everyone,
I tried different ways this issue but I can't fix it.
Elasticsearch service is running.
this is throws exception
Fatal error: Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes found in your cluster in /var/www/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:51 Stack trace: #0 /var/www/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(72): Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection() #1 /var/www/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(90): Elasticsearch\Transport->getConnection() #2 /var/www/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(256): Elasticsearch\Transport->performRequest('GET', '/_cat/indices/%...', Array, NULL, Array) #3 /var/www/vendor/react/promise/src/FulfilledPromise.php(28): Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}(Array) #4 /var/www/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL) #5 /var/www/vendor/guzzlehttp/rin in /var/www/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php on line 51
this is the simple code
require 'vendor/autoload.php';
use Elasticsearch\ClientBuilder;
$client = ClientBuilder::create()->build();
$params = [
'index' => 'zamanbaz-2021.03.29',
'id' => '4nTNS2KcTbOZG5bQSrDGLQ',
'type' => 'Loglar'
];
$response = $client->get($params);
print_r($response);
How can I fix this issue ?