springboot与elasticsearch6.3集成的时候报错:
Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory method 'elasticsearchClient' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
解决:
在springboot的main方法中添加:System.setProperty("es.set.netty.runtime.available.processors","false");
如果是单元测试,也需要在单元测试的开始或构造方法中添加该配置。