Dear team,
recently, I using the java API connect the ES 2.3.3 client which has installed the shield. the error as flows:
Exception in thread "main" NoNodeAvailableException[None of the configured nodes are available:
BTW, I cannot found the user and password setting in elasticsearch.yml. here was my java code:
public static Client getEsConnection()
{
String clusterName = "elasticsearch";
Settings settings = Settings.settingsBuilder()
.put("cluster.name", clusterName)
.build();
Client client = null;
try {
client = TransportClient.builder().settings(settings).build()
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("10.xx.xx.xx"), 9300))
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("10.xx.xx.xx"), 9300))
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("10.xx.xx.xx"), 9300));
} catch (UnknownHostException e) {
e.printStackTrace();
}
return client;
}
Levi,
thanks