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 ...
随机推荐
- Bootstrap 基本模板
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8& ...
- 使用python控制nginx禁封ip
python控制nginx禁封ip nginx中的access.log最近有大量的用户访问,怎么样屏蔽掉在一定时间段内访问次数多的ip呢? 测试准备: 两个tomcat,一个nginx做均衡负载,服务 ...
- linux 防火墙 firewall 设置
背景: 机房断电后导致机器关机重启,原先访问的地址访问不了,使用终端能访问到该服务器,服务启起来后,用curl + 地址能访问,但在外部浏览器访问不了该地址: 首先想到了端口限制----防火墙 参考博 ...
- 高性能集群(HPC
串行计算与并行计算1.串行计算串行计算是指在单个计算机(拥有单个中央独立单元) 上执行软件写操作.CPU 逐个使用一系列指令解决问题.为了加快处理速度,在原有的串行计算的基础上演变出并行计算2.并行计 ...
- 六、用DataContractSerialize类序列化XML
一.层次结构 基类:XmlObjectSerializer 派生类: DataContractSerializer NetDataContractSerializer DataContractJson ...
- vs2017 c# 控制台 输出中文显示问号 ; vs2017 c# 控制台 输出中文显示乱码
问题: 解决: 在main方法最前面加一句就OK了! Console.OutputEncoding = Encoding.GetEncoding("gbk"); 或者 Consol ...
- tcp文件下载
服务器端 import socket def send_file_2_client(new_client_socket,client_addr): # 接收信息 file_name = new_cli ...
- java中日志打印
目录 一.预先判断日志级别 二.避免无效日志打印 三.区别对待错误日志 四.保证记录完整内容 打印日志,要注意下面4点. 一.预先判断日志级别 对DEBUG.INFO级别的日志,必须使用条件输出或者使 ...
- webservice企业开发实例
1. 2. 3.环境变量的配置 4.创建动态web工程-->版本2.5-->tomcat7.0 第一步:创建cxf项目 第二步:添加cxf的jar包 全部将jar包拷入lib目录下 第三步 ...
- 利用webuploader实现超大文件分片上传、断点续传
之前仿造uploadify写了一个HTML5版的文件上传插件,没看过的朋友可以点此先看一下~得到了不少朋友的好评,我自己也用在了项目中,不论是用户头像上传,还是各种媒体文件的上传,以及各种个性的业务需 ...