Spring Boot的Redis启动报错ERR This instance has cluster support disabled
异常描述
在云服务器部署了一个redis,启动基本上都是默认参数,然后Spring Boot新建项目配置如下:
spring:
redis:
cluster:
nodes: 192.168.7.8:6379
在项目启动的时候,报错:
2020-12-20 22:14:17.780 [ok-cloud-cache-service][ WARN ] [12543] [nio-8101-exec-1] [f72eec5ef3575e8e] [f72eec5ef3575e8e] [true] --- [io.lettuce.core.cluster.topology.ClusterTopologyRefresh] [getNodeSpecificViews] [216] : Cannot retrieve partition view from RedisURI [host='192.168.7.8', port=6379], error: java.util.concurrent.ExecutionException: io.lettuce.core.RedisCommandExecutionException: ERR This instance has cluster support disabled
2020-12-20 22:14:17.828 [ok-cloud-cache-service][ WARN ] [12543] [nio-8101-exec-1] [f72eec5ef3575e8e] [f72eec5ef3575e8e] [true] --- [io.lettuce.core.cluster.topology.ClusterTopologyRefresh] [getNodeSpecificViews] [216] : Cannot retrieve partition view from RedisURI [host='192.168.7.8', port=6379], error: java.util.concurrent.ExecutionException: io.lettuce.core.RedisCommandExecutionException: ERR This instance has cluster support disabled
2020-12-20 22:14:17.898 [ok-cloud-cache-service][ ERROR] [12543] [nio-8101-exec-1] [f72eec5ef3575e8e] [f72eec5ef3575e8e] [true] --- [me.yezhou.okcloud.common.config.GlobalWebConfig] [handleException] [78] : Url [/ok-cloud/cache/redis/set] occur exception! interface: CacheRedisController.set, summary info: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisException: Cannot retrieve initial cluster partitions from initial URIs [RedisURI [host='192.168.7.8', port=6379]]
org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisException: Cannot retrieve initial cluster partitions from initial URIs [RedisURI [host='192.168.7.8', port=6379]]
异常分析
从报错信息ERR This instance has cluster support disabled
很明显看得出来,是没有启动Redis集群功能,可是项目配置的集群方式,要么修改代码为单机配置,要么修改Redis为集群方式。
解决办法
1、可以修改配置为单机redis配置:
spring:
redis:
host: 192.168.7.8
port: 6379
2、搭建Redis集群
版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/04/01/spring-boot-redis-startup-error-err-this-instance-has-cluster-support-disabled/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。
THE END
0
二维码
打赏
海报
Spring Boot的Redis启动报错ERR This instance has cluster support disabled
异常描述
在云服务器部署了一个redis,启动基本上都是默认参数,然后Spring Boot新建项目配置如下:
spring:
redis:
cluster:
nodes: 192.168.7.8……
文章目录
关闭
共有 0 条评论