我是Elastic Search Java Api的新手[5.0].我正在使用elasticsearch-5.0.0.我尝试使用Spring Boot创建Java应用程序(Maven).运行应用程序后,它显示
2016-11-04 23:32:19.339 INFO 8280 --- [][generic][T#2]] org.elasticsearch.client.transport : [X-Ray] failed to get node info for [#transport#-1][DESKTOP-8SIPHSN][inet[localhost/127.0.0.1:9300]], disconnecting...
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][cluster:monitor/nodes/info] disconnected
Run Code Online (Sandbox Code Playgroud)
我的配置文件是
@Configuration
public class ElasticsearchConfiguration {
@Bean
public Client client() {
TransportClient client = new TransportClient();
TransportAddress address = new InetSocketTransportAddress("localhost",9300);
client.addTransportAddress(address);
return client;
}
}
Run Code Online (Sandbox Code Playgroud)
我正在使用默认群集"elasticsearch".通过正确检测原因,我需要帮助来解决我的问题.