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 ...
随机推荐
- 运输层5——TCP报文段的首部格式
写在前面:本文章是针对<计算机网络第七版>的学习笔记 运输层1--运输层协议概述 运输层2--用户数据报协议UDP 运输层3--传输控制协议TCP概述 运输层4--TCP可靠运输的工作原理 ...
- python自动化
自动化测试一些问题 什么是自动化测试? 自动化测试,顾名思义,自动完成测试工作.通过一些自动化测试工具或自己造轮子实现模拟之前人工点点/写写的工作并验证其结果完成整个测试过程,这样的测试过程,便是自动 ...
- python 正则表达式特殊字符
字符 描述 \ 将下一个字符标记为一个特殊字符.或一个原义字符.或一个 向后引用.或一个八进制转义符.例如,'n' 匹配字符 "n".'\n' 匹配一个换行符.序列 '\\' 匹配 ...
- CSP-S 2019 第二轮 退役记
Day 0 复习数论,复习网络流,复习动态DP,复习ac自动机,复习后缀自动机- Day 1 进考场,得到解压密码,跟时事热点没有什么关系. 感觉键盘有点难受,右半部分包括退格.方向键.回车都比较黏. ...
- Number of Islands II
Given a n,m which means the row and column of the 2D matrix and an array of pair A( size k). Origina ...
- 16 | “order by”是怎么工作的?
在你开发应用的时候,一定会经常碰到需要根据指定的字段排序来显示结果的需求.还是以我们前面举例用过的市民表为例,假设你要查询城市是“杭州”的所有人名字,并且按照姓名排序返回前1000个人的姓名.年龄. ...
- MongoDB 副本集节点添加与删除
replica set多服务器主从,添加,删除节点,肯定会经常遇到的.下面详细说明一下,添加,删除节点的2种方法. 一,利用rs.reconfig,来添加,删除节点 1,添加节点 查看复制打印 rep ...
- MongoDB存储引擎、索引 原
wiredTiger MongoDB从3.0开始引入可插拔存储引擎的概念.目前主要有MMAPV1.WiredTiger存储引擎可供选择.在3.2版本之前MMAPV1是默认的存储引擎,其采用linux操 ...
- 002_Python3 基础语法
1.注释 实例1: #!/usr/bin/python3 # 第一个注释 print("Hello, Python!") # 第二个注释 ****************** ...
- Apache的安装和配置
一.官网下载Apache 官网地址:https://httpd.apache.org/ 点击Download--->点击Files for Microsoft Windows--->点击A ...