Springboot整合Elasticsearch报错availableProcessors is already set to [4], rejecting [4]
Springboot整合Elasticsearch报错
今天使用SpringBoot整合Elasticsearch时候,相关的配置完成后,启动项目就报错了。
nested exception is java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
我网上查询了一下,有人是是因为整合了Redis的原因。但是我把Redis相关的配置去掉后,问题还是没有解决,最后有人说是因为netty冲突的问题。
也有人给出了解决方式就是在项目初始化钱设置一下一个属性。在初始化之前加上System.setProperty(“es.set.netty.runtime.available.processors”, “false”);
@Configuration
public class ElasticSearchConfig {
@PostConstruct
void init() {
System.setProperty("es.set.netty.runtime.available.processors", "false");
}
}
我按照这种方法还是没有解决我这边项目的问题。
最后我直接把System.setProperty(“es.set.netty.runtime.available.processors”, “false”);
发现这样可以解决我这边的问题。
@SpringBootApplication
public class EurekaBussnissServiceUserApplication { public static void main(String[] args) {
// System.out.println("===========================================");
/**
* Springboot整合Elasticsearch 在项目启动前设置一下的属性,防止报错
* 解决netty冲突后初始化client时还会抛出异常
* java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
*/
System.setProperty("es.set.netty.runtime.available.processors", "false");
SpringApplication.run(EurekaBussnissServiceUserApplication.class, args);
}
}
Springboot整合Elasticsearch报错availableProcessors is already set to [4], rejecting [4]的更多相关文章
- springboot整合activiti报错[processes/]不存在解决方案
springboot整合activiti时,启动抛异常 nested exception is java.io.FileNotFoundException: class path resource [ ...
- SpringBoot:springboot整合eureka报错 Unable to start embedded Tomcat
报错信息: org.springframework.context.ApplicationContextException: Unable to start web server; nested ex ...
- springboot整合jsp报错
今天在学springboot整合jsp时遇到了一个问题,虽然jsp不被spring官方推荐使用,但抱着学习的心态还是想解决一下这个问题.在写好了需要pom文件之后,访问网站得到了500的错误提示,后台 ...
- springboot整合mybatis报错:Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation...
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis- ...
- springboot 整合spark-sql报错
Exception in thread "main" org.spark_project.guava.util.concurrent.ExecutionError: java.la ...
- SpringBoot整合Dubbo报错: java.lang.ClassCastException
com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method queryGoodsLimitPage to regi ...
- springboot整合cache报错org.springframework.cache.ehcache.EhCacheCacheManager cannot be cast to net.sf.ehcache.CacheManager
原来的代码 private static CacheManager cacheManager = SpringContextHolder.getBean("cacheManager" ...
- springboot整合mybatis报错
java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more ...
- ElasticSearch(2)---SpringBoot整合ElasticSearch
SpringBoot整合ElasticSearch 一.基于spring-boot-starter-data-elasticsearch整合 开发环境:springboot版本:2.0.1,elast ...
随机推荐
- 提速1000倍,预测延迟少于1ms,百度飞桨发布基于ERNIE的语义理解开发套件
提速1000倍,预测延迟少于1ms,百度飞桨发布基于ERNIE的语义理解开发套件 11月5日,在『WAVE Summit+』2019 深度学习开发者秋季峰会上,百度对外发布基于 ERNIE 的语义理解 ...
- C++读取中文或英文文件空格分割
// show file content - sbumpc() example #include <iostream> // std::cout, std::streambuf #incl ...
- Mybatis二级缓存的简单应用
1.接口 public interface MemberMapperCache { public Members selectMembersById(Integer id); } 2.POJO类 实现 ...
- 【CCF CSP】 20171203 行车路线 Java(有问题)80分
问题描述 小明和小芳出去乡村玩,小明负责开车,小芳来导航. 小芳将可能的道路分为大道和小道.大道比较好走,每走1公里小明会增加1的疲劳度.小道不好走,如果连续走小道,小明的疲劳值会快速增加,连续走s公 ...
- pandas 数据类型研究(一)数据转换
当利用pandas进行数据处理的时候,经常会遇到数据类型的问题,当拿到数据的时候,首先需要确定拿到的是正确类型的数据,一般通过数据类型的转化,这篇文章就介绍pandas里面的数据类型(data typ ...
- 洛谷P2221 高速公路【线段树】
题目:https://www.luogu.org/problemnew/show/P2221 题意:有n个节点排成一条链,相邻节点之间有一条路. C u v val表示从u到v的路径上的每条边权值都加 ...
- SQL死锁处理
查询死锁 select request_session_id spid, OBJECT_NAME(resource_associated_entity_id) tableName from sys.d ...
- E:nth-last-child(n)
E:nth-last-child(n) 语法: E:nth-last-child(n) { sRules } 说明: 匹配父元素的倒数第n个子元素E,假设该子元素不是E,则选择符无效.大理石平台维修 ...
- MVC4 Application Install
For VS2010 http://www.asp.net/mvc/mvc4 For VS2012 http://www.asp.net/downloads
- 通过 Ajax 调取后台接口将返回的 json 数据绑定在页面上
第一步: 编写基础的 html 框架内容,并引入 jquery: <!doctype html> <html lang="en"> <head> ...