Elastic Transport client on AWS Managed ElasticSearch

三世轮回 提交于 2019-12-09 14:26:09

问题


I am trying to use the AWS Managed ElasticSearch for my project.

I have followed https://aws.amazon.com/blogs/aws/new-amazon-elasticsearch-service/ and i am able to start an instance and which is successfull. But I am unable to connect to the same instance from my service using elasticsearch transport client.

I know transport client supposed to connect on to the 9300 port, and that port i am unable to turn on through the aws console.

Here is the code that I am using to connect, which is successfully able to connect to my elastic search setup on an ec2 machine on the 9300 port.

ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
                    settings.put("cluster.name", "my-cluster-name")
                            .put("client.transport.nodes_sampler_interval", "15s")
                            .put("client.transport.ping_timeout", "15s")
                            .put("client.transport.sniff", true)
                            .put("client.transport.ignore_cluster_name", false).build();
                    client = new TransportClient(settings)
                        .addTransportAddress(
                            new InetSocketTransportAddress(
                                        env.getProperty("elastic-host-url-provided-by-aws",80)
                            ));

I am getting the Exception

org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [] at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:305) at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:200) at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106) at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:98)

I suspect that this error is since I am connecting the TransportClient over the HTTP port. But I dunno what is the TCP port for aws managed elastic search instance. I searched in aws documents, and i couldnt find any. If some have used TransportClient to connect with Amazon ES let me know.

NB: I have verified that the elasticsearch java jar version that I am using is as same as same with the server. And from my system I am able to access the Kibana and the ES HTTP PORTS with out any issue.


回答1:


AWS related Forum link.

Here are the restrictions for AWS ElasticSearch service:

TCP transport The service supports HTTP on port 80, but does not support TCP transport.




回答2:


The documentation section about missing support to TCP transport for AWS Elasticsearch 5.x domains can be found here:

TCP transport

The service supports HTTP on port 80, but does not support TCP transport.



来源:https://stackoverflow.com/questions/33286270/elastic-transport-client-on-aws-managed-elasticsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!