数据库
首页 > 数据库> > spring链接redis报错 Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionExcept

spring链接redis报错 Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionExcept

作者:互联网

记录一次生产环境的redis切换事故
生产环境redis切换,由原来的直连ip服务改为阿里的redis集群,出现了链接失败的错误
org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: MOVED 12910 172.16.4.99:6379
原因是集群的spring配置方式和单机的不一样
单机的链接方式

spring: 
  redis:
    host: 127.0.0.1
    port: 6379
    password: 123
    database: 0

集群配置方式

spring: 
  redis:
    cluster:
      nodes: safasafdsasdasas.dsad.asf.aliyuncs.com:6379
    password: dsafdfaasdf
    database: 0

标签:core,exception,spring,redis,nested,6379,报错,集群,链接
来源: https://www.cnblogs.com/darling331/p/16499917.html