在使用时依赖和包都没有少一切正常但是一直报
Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory method 'esTransportClientInit' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]
可以在启动类中的main方法中加上
System.setProperty("es.set.netty.runtime.available.processors", "false");
这样就可以解决问题了
具体的按照网上的分析是
大致的问题差不多就是redis和es一起时候netty相关设置初始化数的问题,看springboot源码时候知道spring的autoconfigeration系列自动配置是有个先后顺序的,当你在配置文件中打开debug = true 的时候就能看到相应的自动配置启动顺序。
但是在感觉上还是不对这个解释有点牵强,而且我先启动es再启动redis还是报错;
有望解决!!!!!!希望多多评论学习