码迷,mamicode.com
首页 > 其他好文 > 详细

availableProcessors is already set to [8], rejecting [8]

时间:2020-05-08 00:29:37      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:cat   source   run   elastics   通过   arc   搜索   lang   ted   

错误详细信息:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name elasticsearchClient 
defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory method elasticsearchClient threw exception;
nested exception is java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]

关键信息如下:

Caused by: java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]

通过关键字搜索,找到了解决办法,原因是因为SpringBoot的netty和elasticsearch的netty相关jar冲突

只需在启动类加入如下代码即可解决(注意,这段代码要放在SpringApplication.run(Application.class, args)之前才行,否则不会生效):

System.setProperty("es.set.netty.runtime.available.processors", "false");

 

availableProcessors is already set to [8], rejecting [8]

标签:cat   source   run   elastics   通过   arc   搜索   lang   ted   

原文地址:https://www.cnblogs.com/youcong/p/12846828.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!