org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
刚开始接触ElasticSearch, 代码刚刚还好好的, 忽然间就报了这个错误, 然后ElasticSearch也连接不上了.
跟同事沟通后才知道是由于他重启了ElasticSearch所在的服务器.
还有可能是以下几种错
1 端口错
client = new TransportClient().addTransportAddress(new InetSocketTransportAddress(ipAddress, 9300));
这里9300 写成9200的话会No node available
要是你连的不是本机,注意IP有没有正确
2 jar报引用版本不匹配,开启的服务是什么版本,引用的jar最好匹配(这个我没有去试,反正我的是匹配的)
3 要是你改了集群名字,还有设置集群名字
Settings settings = ImmutableSettings.settingsBuilder().put(“cluster.name”, “xxx”).build();
client = new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(ipAddress, 9300));