小编Mr.*_*rue的帖子

想同时使用redis和elasticsearch,但是它的错误,例如“” availableProcessors已设置为[4],拒绝了[4]”

 ERROR:Factory method 'elasticsearchClient' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
Run Code Online (Sandbox Code Playgroud)

我只想同时使用redis和elasticsearch吗?pom.xml:

<dependency>
    <!-- elasticsearch:5.6.10-->
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    <version>2.0.4.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
    <version>2.0.4.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

当我只使用redis或只使用elasticsearch时可以,但是如果结合使用会出错。
错误信息:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-09-04 20:23:34.284 ERROR 99054 --- [  restartedMain] org.springframework.boot.SpringApplication.reportFailure[845] : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'controller_StudentEs': Unsatisfied dependency expressed through field 'studentEsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with …
Run Code Online (Sandbox Code Playgroud)

redis elasticsearch spring-boot

5
推荐指数
1
解决办法
368
查看次数

标签 统计

elasticsearch ×1

redis ×1

spring-boot ×1