I am starting to work with elastic search. I successfully install elastic search on my server (as opposed to the application server). But when I try to call Elatic search from my application server, it gives Fatal error: Uncaught exception 'Elasticsearch\Common\Exceptions\NoNodesAvailableException' with message 'No alive nodes found in your cluster'
When I check the Elastic search status, it shows Active .
What can I call elastic search from my application server on my Elastic search server.
<?php require 'vendor/autoload.php'; $hosts = [ 'ip_address:9200' // IP + Port ]; $client = Elasticsearch\ClientBuilder::create()->setHosts($hosts)->build(); $params = [ 'index' => 'my_index', 'type' => 'my_type', 'id' => 'my_id', 'body' => ['testField' => 'abc'] ]; $response = $client->index($params); ?>
Elasticsearch.yml settings
# ======================== Elasticsearch Configuration =========================
elasticsearch.yml settings that do not work
network.host: 127.0.0.1
network.host: 0
network.host: 0.0.0.0
network.host: IP_Address
network.bind_host: 0
network.bind_host: IP_Address
When I set the above settings, elasticsearch shows a failed status.
NOTE. Sustainable search is installed on another server from my application.
source share