elasticsearch系列(四): bug收集

Factory method 'elasticsearchClient' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]

报错环境: springboot + redis + elasticsearch

原因: redis和elasticsearch有冲突。

解决方案:

  • 启动类加 System.setProperty("es.set.netty.runtime.available.processors","false");
  • 单元测试的话,在单元测试类的空构造函数中加上面的代码
  public ElasticTest(){
    	System.setProperty("es.set.netty.runtime.available.processors","false");
  }

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

报错环境: docker搭建es集群启动

原因: elasticsearch用户拥有的内存权限太小,至少需要262144;

解决方案:

Elasticsearch health check failed

报错环境: springboot + actuator + elasticsearch

原因: 健康检查默认127.0.0.1与es集群ip不一致

解决方案:

Springboot ElasticSearch QueryBuilder 查不到数据

原因: es的分页从第0页开始,而不是第1页

这位兄弟,真是神了,这个问题差不多困扰了我半天,头疼~~~我就3条数据,死活用第1页就是查不出来,感谢!!!

原文地址:https://www.cnblogs.com/linyufeng/p/13046892.html