我使用org.springframework.boot:spring-boot-starter-data-elasticsearch
设置了一个网络应用。一切都运作良好 - 我可以用我的独立Elasticsearch 5填充索引。但我仍然收到一些奇怪的警告:
2018-05-08 03:07:57.940 WARN 32053 --- [ient_boss][T#7]] o.e.transport.TransportService : Transport response handler not found of id [5]
2018-05-08 03:08:02.949 WARN 32053 --- [ient_boss][T#8]] o.e.transport.TransportService : Transport response handler not found of id [7]
2018-05-08 03:08:07.958 WARN 32053 --- [ient_boss][T#1]] o.e.transport.TransportService : Transport response handler not found of id [9]
2018-05-08 03:08:12.970 WARN 32053 --- [ient_boss][T#2]] o.e.transport.TransportService : Transport response handler not found of id [11]
...
简单的应用程序重现:
@SpringBootApplication
public class App {
@Configuration
@EnableElasticsearchRepositories(basePackages = "com.test")
public class EsConfig {
@Value("${elasticsearch.host}")
private String esHost;
@Value("${elasticsearch.port}")
private int esPort;
@Value("${elasticsearch.clustername}")
private String esClusterName;
@Bean
public TransportClient client() throws Exception {
Settings esSettings = Settings.builder().put("cluster.name", esClusterName).build();
InetSocketTransportAddress socketAddress = new InetSocketTransportAddress(
InetAddress.getByName(esHost), esPort);
return new PreBuiltTransportClient(esSettings).addTransportAddress(socketAddress);
}
@Bean
public ElasticsearchOperations elasticsearchTemplate(Client client) throws Exception {
return new ElasticsearchTemplate(client);
}
}
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
我的ES撰写文件
version: "2.3"
services:
elasticsearch:
image: 'docker.elastic.co/elasticsearch/elasticsearch:5.6.8
ports:
- "9200:9200"
- "9300:9300"
environment:
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms700m -Xmx700m
- PATH_LOGS="/tmp/el-log"
- cluster.name=dou
cpu_shares: 1024
mem_limit: 1024MB
作为项目传递依赖,我有org.elasticsearch.client:transport:5.6.8
。看起来像ES实例和版本的版本图书馆是一样的。
那么,这个警告意味着什么呢?我们该如何应对呢?