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

Add support for ES nodes without public address #1693

Merged
merged 2 commits into from
Oct 8, 2019

Conversation

martint
Copy link
Member

@martint martint commented Oct 8, 2019

No description provided.

@cla-bot cla-bot bot added the cla-signed label Oct 8, 2019
@martint martint requested a review from dain October 8, 2019 05:28
@@ -305,7 +305,7 @@ private static void validateCertificates(KeyStore keyStore)

private Set<ElasticsearchNode> fetchNodes()
{
NodesResponse nodesResponse = doRequest("_nodes/http", NODES_RESPONSE_CODEC::fromJson);
NodesResponse nodesResponse = doRequest("/_nodes/http", NODES_RESPONSE_CODEC::fromJson);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this do doRequest:

checkArgument(path.startsWith("/"), ........);

AWS Elasticsearch fails with 400-Bad Request unless the URIs are absolute.
In AWS, nodes don't have a public HTTP address. All requests
must go through the Elasticsearch domain endpoint.

With this change, the list of nodes available to the REST client
is only updated if there's at least one node with an HTTP address.
Otherwise, the client continues to use the "bootstrap" host/port
it was configured with.
@martint martint force-pushed the elastic-no-address branch from a544650 to 1f7d38e Compare October 8, 2019 15:39
@martint martint merged commit 1f7d38e into trinodb:master Oct 8, 2019
@martint martint deleted the elastic-no-address branch October 8, 2019 15:39
@martint martint mentioned this pull request Oct 8, 2019
6 tasks
@martint martint added this to the 321 milestone Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants