-
Notifications
You must be signed in to change notification settings - Fork 982
No alive nodes found in your cluster #509
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
Comments
To be honest, I'm not super familiar with AWS ES. That error basically means it can't find your cluster, likely due to misconfiguration on either the client's side or the server's side. How have you configured access control to the cluster? You may need to use the extended host config syntax E.g. $hosts = [
[
'host' => 'search-instance-name-912ec803b2ce49.us-east-1.es.amazonaws.com',
'port' => '443',
'scheme' => 'https',
//'user' => 'username', //not sure if you need these on AWS?
// 'password' => 'password!#$?*abc'
]
];
$client = ClientBuilder::create() // Instantiate a new ClientBuilder
->setHosts($hosts) // Set the hosts
->build(); // Build the client object You might also try dropping the port 443, because there was (at least at one time) issues with how AWS validates authentication via canocalized URLS (see #309) So maybe try this: $hosts = [
[
'host' => 'search-instance-name-912ec803b2ce49.us-east-1.es.amazonaws.com',
'scheme' => 'https'
]
];
$client = ClientBuilder::create() // Instantiate a new ClientBuilder
->setHosts($hosts) // Set the hosts
->build(); // Build the client object |
I've tried that but to no avail. I have another server on Linode that I use for development. Putting in the AWS ES endpoint there and running the commands from there works and properly indexes the documents. I'm thinking this issue is related to either a server configuration, that a possibility? |
Hm ok. Time to roll up the sleeves and start debugging :) Can you try running a request with verbose toggled on, and checking the last-connection info? Like this: $params = [
// set your params here
];
// toggle verbosity
$params['client']['verbose'] = true;
try {
$response = $client->index($params);
print_r($response);
catch (Exception $e) {
$last = $client->transport->getLastConnection()->getLastRequestInfo();
$last['response']['error'] = [];
print_r($last);
} I'm not quite sure how you'll do that with Laravel, but basically we want to add Also make sure you're on the most recent version of ES-PHP, just to simplify debugging ( Another option is to try using CurlCaBundle or Composer/ca-bundle instead of the SSL certs on your system... just in case they are out of date or something similar. You can find more information regarding using them with the client here: https://www.elastic.co/guide/en/elasticsearch/client/php-api/5.0/_security.html#_public_ca_certificates |
Oh, another option is to go back to HTTP like you first tried, but explicitly set the port to 80. The client defaults HTTP connections to 9200 because that's what ES uses by default, but I seem to remember that the AWS service uses 80 instead. |
I have the same problem when using Elasticsearch 5.1.1. |
I've also run into this issue using the elasticsearch php client. AWS ES only runs over port 80 or 443 using a REST API and doesn't support the ES Transport protocol by default (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-limits.html) . The only way to get the client working seems to be to set it to http and to manually set the port to 80. Can't seem to get https and port 443 working. Shame Amazon don't offer proper client libraries or support existing ones. $client_builder = ClientBuilder::create(); |
For anyone struggling for an answer I came across an issue with this today. I'm using Docker and had internal hostnames with underscores (ie, There's more of an explanation on SO - https://stackoverflow.com/questions/56111471/hostname-resolution-not-working-from-within-elasticsearch-client-under-docker/56113504#56113504 |
Outdated issue. @zakiaziz if this still relevant I'll reopen it. |
Summary of problem or feature request
I have a laravel app (v5.1) and I'm actually using this library: https://github.com/elasticquent/Elasticquent which is a wrapper around elasticsearch-php. The app is hosted on an EC2 instance and doing a cURL request from there returns a response:
Elasticquent gives a way to insert records from a DB into elasticsearch and that's the code which is returning an error. (below)
Code snippet of problem
Here is a gist of the exception stack trace incase it helps: https://gist.github.com/zakiaziz/1fa94f9c3f504a5a9bc756ebd96f9065
I've tried changing my host to
https://search-instance-name-912ec803b2ce49.us-east-1.es.amazonaws.com:443
but no luck. also tried putting in a newer version (2.3.0) incomposer.json
with no luckSystem details
The text was updated successfully, but these errors were encountered: