SpringBoot整合Elasticsearch报错
启动项目时报 Caused by: java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
解决办法:
将下面这行代码加在SpringBoot的启动类里面即可
System.setProperty(“es.set.netty.runtime.available.processors”, “false”);
@SpringBootApplication
public class CoreApplication {
public static void main(String[] args) {
System.setProperty("es.set.netty.runtime.available.processors", "false");
SpringApplication.run(CoreApplication.class, args);
}
}