jeecgboot / JeecgBoot

🔥「企业级低代码平台」前后端分离架构SpringBoot 2.x/3.x,SpringCloud,Ant Design&Vue3,Mybatis,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式,引入AI模型能力 OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。
http://www.jeecg.com
Apache License 2.0
40.73k stars 14.85k forks source link

Redis集群,把其中一台的服务停了,不会跳过它,从而导致页面报错? #7269

Closed 45592858 closed 1 month ago

45592858 commented 1 month ago
版本号:

3.6.2

问题描述:

我的配置如下,是不是配置有问题?

redis: cluster: nodes:

错误截图:

2024-09-24 19:48:43.708 [http-nio-8080-exec-6] INFO o.jeecg.modules.system.controller.LoginController:610 - 获取验证码,Redis key = bdc37da4726946726880b1dcf73147a7,checkCode = 6Vfs 2024-09-24 19:48:43.895 [http-nio-8080-exec-10] INFO o.jeecg.modules.system.controller.LoginController:610 - 获取验证码,Redis key = d6d50dbbda718a9bdc88943a9cf1162c,checkCode = X1H2 2024-09-24 19:48:44.593 [http-nio-8080-exec-1] INFO o.jeecg.modules.system.controller.LoginController:610 - 获取验证码,Redis key = 36808fea2fff2ed4aa2a1bcdb1d79a2d,checkCode = yu2n 2024-09-24 19:49:10.854 [lettuce-eventExecutorLoop-1-11] INFO io.lettuce.core.protocol.ConnectionWatchdog:171 - Reconnecting, last destination was /192.168.0.147:6379 2024-09-24 19:49:12.872 [lettuce-nioEventLoop-4-14] WARN io.lettuce.core.protocol.ConnectionWatchdog:151 - Cannot reconnect to [192.168.0.147:6379]: Connection refused: no further information: /192.168.0.147:6379 2024-09-24 19:49:17.150 [lettuce-eventExecutorLoop-1-14] INFO io.lettuce.core.protocol.ConnectionWatchdog:171 - Reconnecting, last destination was 192.168.0.147:6379 2024-09-24 19:49:19.160 [lettuce-nioEventLoop-4-1] WARN io.lettuce.core.protocol.ConnectionWatchdog:151 - Cannot reconnect to [192.168.0.147:6379]: Connection refused: no further information: /192.168.0.147:6379 2024-09-24 19:49:20.611 [http-nio-8080-exec-2] INFO o.jeecg.modules.system.controller.LoginController:610 - 获取验证码,Redis key = d128400cbb1b161d3afa76235346a0ea,checkCode = jAX2 2024-09-24 19:49:22.876 [http-nio-8080-exec-3] INFO o.jeecg.modules.system.controller.LoginController:610 - 获取验证码,Redis key = 318994e214f9b84688ae7996bcc55691,checkCode = SAam 2024-09-24 19:49:23.450 [lettuce-eventExecutorLoop-1-2] INFO io.lettuce.core.protocol.ConnectionWatchdog:171 - Reconnecting, last destination was 192.168.0.147:6379 2024-09-24 19:49:23.608 [http-nio-8080-exec-4] INFO o.jeecg.modules.system.controller.LoginController:610 - 获取验证码,Redis key = d220e422d950f1f13b739660b68f872f,checkCode = 225M 2024-09-24 19:49:25.461 [lettuce-nioEventLoop-4-4] WARN io.lettuce.core.protocol.ConnectionWatchdog:151 - Cannot reconnect to [192.168.0.147:6379]: Connection refused: no further information: /192.168.0.147:6379 2024-09-24 19:49:30.550 [lettuce-eventExecutorLoop-1-8] INFO io.lettuce.core.protocol.ConnectionWatchdog:171 - Reconnecting, last destination was 192.168.0.147:6379 2024-09-24 19:49:32.557 [lettuce-nioEventLoop-4-7] WARN io.lettuce.core.protocol.ConnectionWatchdog:151 - Cannot reconnect to [192.168.0.147:6379]: Connection refused: no further information: /192.168.0.147:6379 2024-09-24 19:49:37.750 [lettuce-eventExecutorLoop-1-10] INFO io.lettuce.core.protocol.ConnectionWatchdog:171 - Reconnecting, last destination was 192.168.0.147:6379 2024-09-24 19:49:39.756 [lettuce-nioEventLoop-4-9] WARN io.lettuce.core.protocol.ConnectionWatchdog:151 - Cannot reconnect to [192.168.0.147:6379]: Connection refused: no further information: /192.168.0.147:6379 2024-09-24 19:49:43.950 [lettuce-eventExecutorLoop-1-12] INFO io.lettuce.core.protocol.ConnectionWatchdog:171 - Reconnecting, last destination was 192.168.0.147:6379 2024-09-24 19:49:45.965 [lettuce-nioEventLoop-4-10] WARN io.lettuce.core.protocol.ConnectionWatchdog:151 - Cannot reconnect to [192.168.0.147:6379]: Connection refused: no further information: /192.168.0.147:6379 2024-09-24 19:49:54.249 [lettuce-eventExecutorLoop-1-14] INFO io.lettuce.core.protocol.ConnectionWatchdog:171 - Reconnecting, last destination was 192.168.0.147:6379 2024-09-24 19:49:56.256 [lettuce-nioEventLoop-4-11] WARN io.lettuce.core.protocol.ConnectionWatchdog:151 - Cannot reconnect to [192.168.0.147:6379]: Connection refused: no further information: /192.168.0.147:6379 2024-09-24 19:50:12.651 [lettuce-eventExecutorLoop-1-1] INFO io.lettuce.core.protocol.ConnectionWatchdog:171 - Reconnecting, last destination was 192.168.0.147:6379 2024-09-24 19:50:14.658 [lettuce-nioEventLoop-4-12] WARN io.lettuce.core.protocol.ConnectionWatchdog:151 - Cannot reconnect to [192.168.0.147:6379]: Connection refused: no further information: /192.168.0.147:6379 org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute(s) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:70) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:277) at org.springframework.data.redis.connection.lettuce.LettuceConnection.await(LettuceConnection.java:1085) at org.springframework.data.redis.connection.lettuce.LettuceConnection.lambda$doInvoke$4(LettuceConnection.java:938) at org.springframework.data.redis.connection.lettuce.LettuceInvoker$Synchronizer.invoke(LettuceInvoker.java:673) at org.springframework.data.redis.connection.lettuce.LettuceInvoker$DefaultSingleInvocationSpec.get(LettuceInvoker.java:589) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.setEx(LettuceStringCommands.java:167) at org.springframework.data.redis.connection.DefaultedRedisConnection.setEx(DefaultedRedisConnection.java:335) at org.springframework.data.redis.core.DefaultValueOperations$8.potentiallyUsePsetEx(DefaultValueOperations.java:337) at org.springframework.data.redis.core.DefaultValueOperations$8.doInRedis(DefaultValueOperations.java:330) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:191) at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:97) at org.springframework.data.redis.core.DefaultValueOperations.set(DefaultValueOperations.java:325) at org.jeecg.common.util.RedisUtil.set(RedisUtil.java:125) at org.jeecg.modules.system.controller.LoginController.randomImage(LoginController.java:609) at org.jeecg.modules.system.controller.LoginController$$FastClassBySpringCGLIB$$b307ab61.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) at org.jeecg.common.aspect.DictAspect.doAround(DictAspect.java:62) at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)

友情提示:

EightMonth commented 1 month ago

jeecg默认使用的是lettuce作为redis客户端的集群代理,另外jedis不支持自动刷新redis集群信息,只能手动刷新,只有lettuce才支持

可使用该配置自动清理失效集群实例

spring:
  redis:
    lettuce:
      cluster:
        refresh:
          adaptive: true  # 自适应刷新拓扑