我一直收到这个错误:
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
我的弹性搜索在AWS Ubuntu Linux上。
我的TransportClient包装如下:
@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