简体   繁体   English

AWS Managed ElasticSearch 上的 Elastic Transport 客户端

[英]Elastic Transport client on AWS Managed ElasticSearch

I am trying to use the AWS Managed ElasticSearch for my project.我正在尝试将 AWS Managed ElasticSearch 用于我的项目。

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.我已经关注了https://aws.amazon.com/blogs/aws/new-amazon-elasticsearch-service/并且我能够启动一个实例并且成功了。 But I am unable to connect to the same instance from my service using elasticsearch transport client.但是我无法使用 elasticsearch 传输客户端从我的服务连接到同一个实例。

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.我知道传输客户端应该连接到 9300 端口,而我无法通过 aws 控制台打开该端口。

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.这是我用来连接的代码,它能够成功连接到 9300 端口上的 ec2 机器上的弹性搜索设置。

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) org.elasticsearch.client.transport.NoNodeAvailableException:没有配置的节点可用:[] at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:305) at org.elasticsearch.client.transport.TransportClientNodesService。在 org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106) 在 org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:98) 执行(TransportClientNodesService.java:200)

I suspect that this error is since I am connecting the TransportClient over the HTTP port.我怀疑这个错误是因为我通过 HTTP 端口连接了 TransportClient。 But I don't know, what is the TCP port for aws managed elastic search instance.但我不知道,aws 托管的弹性搜索实例的 TCP 端口是什么。 I searched in aws documents, and i couldnt find any.我在 aws 文件中搜索,但找不到任何文件。 If some have used TransportClient to connect with Amazon ES let me know.如果有人使用 TransportClient 与 Amazon ES 连接,请告诉我。

NB: I have verified that the elasticsearch java jar version that I am using is as same as same with the server.注意:我已验证我使用的 elasticsearch java jar 版本与服务器相同。 And from my system I am able to access the Kibana and the ES HTTP PORTS with out any issue.从我的系统中,我可以毫无问题地访问 Kibana 和 ES HTTP 端口。

AWS related Forum link . AWS 相关论坛链接

Here are the restrictions for AWS ElasticSearch service: 以下是 AWS ElasticSearch 服务的限制:

TCP transport The service supports HTTP on port 80, but does not support TCP transport. TCP 传输 该服务支持端口 80 上的 HTTP,但不支持 TCP 传输。

The documentation section about missing support to TCP transport for AWS Elasticsearch 5.x domains can be found here :可以在此处找到有关缺少对 AWS Elasticsearch 5.x 域的 TCP 传输支持的文档部分:

TCP transport TCP传输

The service supports HTTP on port 80, but does not support TCP transport.该服务支持端口 80 上的 HTTP,但不支持 TCP 传输。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM