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集群

上一篇 Redis队列的实现
下一篇 Redis 6 集群安装
目录
文章列表
1 Appium自动化测试(6)—— python-client安装与测试
Appium自动化测试(6)—— python-client安装与测试
2
Spring Cloud Feign传递map对象和多媒体文件
Spring Cloud Feign传递map对象和多媒体文件
3
Android RecycleView全部item倒计时的高效实现
Android RecycleView全部item倒计时的高效实现
4
Groovy代码示例 - groovy脚本中如何调用及包含其他的脚本?
Groovy代码示例 - groovy脚本中如何调用及包含其他的脚本?
5
MySQL修改时区的方法小结
MySQL修改时区的方法小结
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。