Java elasticsearch远程客户端到AWS
我不断地发现这个错误:Java elasticsearch远程客户端到AWS,java,amazon-web-services,
elasticsearch,Java,Amazon Web Services,
elasticsearch,我不断地发现这个错误: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [] 我的elasticsearch在AWS Ubuntu Linux上 我的客户机是这样包装的: @SuppressWarnings("resource") public ClientTransport(){ Settings se
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
我的elasticsearch在AWS Ubuntu Linux上
我的客户机是这样包装的:
@SuppressWarnings("resource")
public ClientTransport(){
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "store_cluster").build();
this.client = new TransportClient(settings)
.addTransportAddress(new InetSocketTransportAddress("xx.xx.xx.xx", 9300));
}
我的测试班:
ClientTransport c = new ClientTransport();
CreateIndexResponse create = c.client.admin().indices()
.create(new CreateIndexRequest("logstash-2015.06.04")).actionGet();
if (!create.isAcknowledged()) {
System.out.println("failed to create index: " + indexName);
} else {
System.out.println("Index created. Index Name: " + indexName);
}
c.client.close();
我看到很多关于这个的讨论,但我不明白解决方案
这里是elasticsearch.yml。以下是我的文件中唯一的配置:
network.host: localhost
cluster.name: store_cluster
node.name: store_node
您是否已验证连接到
xx.xx.xx.xx:9300
的机器实际上可以看到服务器和端口?换句话说,您是否打开AWS机器上位于xx.xx.xx.xx
的端口9300,以便客户端机器可以连接到它?此外,请验证群集名称是否正确。最后,您可以检查ES节点上的日志。如果它没有显示任何连接尝试,那么它们很可能被防火墙阻止。仍然得到相同的错误。端口已打开,所有端口均已关闭。因此,即使我在本地运行,它也会失败。那么您可以为ES节点添加设置吗?您是否也可以显示并检查其相关时间段的日志(尝试连接,然后查看ES的服务器端是否出现任何错误)?运行:sudo ufw status在防火墙上显示“status:inactive”。请尝试ES本身而不是防火墙的日志。