解决:Error creating bean with name 'elasticsearchClient', AvailableProcessors is already set to [4]

第一:

先看你的pom文件是否用了redis

        
            org.springframework.boot
            spring-boot-starter-data-redis
        

如果在同时使用elastic search,请加上版本号

        
            org.springframework.boot
            spring-boot-starter-data-redis
            2.0.4.RELEASE
        

如果启动还是报错, 请尝试在Application.class类中加上一句:

System.setProperty("es.set.netty.runtime.available.processors", "false");
public class SpringBootTestApplication extends SpringBootServletInitializer {

    public static void main(String[] args) throws Exception {
        System.setProperty("es.set.netty.runtime.available.processors", "false");
        SpringApplication.run(SpringBootTestApplication.class, args);
    }
}

 

第二:根据你的es版本,是否需要客户端pom , 请看API-JAVA-ES官方网站

类似的加入:

        
            org.elasticsearch.client
            transport
            5.6.10
        

第三:你的elastic客户端和服务端版本是否一致? 去maven仓库看你依赖对应的版本,保持一致即可

你可能感兴趣的:(elasticsearch,spring,boot)