ruoyi-cloud启动常见问题处理
1:启动ruoyi-auth或其他任意模块提示nacos无法连接
com.alibaba.nacos.api.exception.NacosException: Client not connected, current status:STARTING
解决办法:
<spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>
修改为:
<spring-cloud-alibaba.version>2021.0.1.0</spring-cloud-alibaba.version>
pom.xml重新引入后再启动
2:启动ruoyi-system时提示错误:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'captchaController': Unsatisfied dependency expressed through field 'configService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysConfigServiceImpl': Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to
原因:redis无法连接导致
解决办法:核对redis的ip和端口号,密码信息是否正确
3:redis信息设置正确,ruoyi-system启动提示类似如下信息
nested exception is org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: MOVED 15592 10.10.10.18:8003
原因:
OVED 15592 10.21.1.189:8003
是Redis集群的标准响应- 表示你尝试操作的key(槽位15592)实际位于节点10.21.1.189:8003上
- 客户端没有正确处理集群重定向
解决办法:
配置集群模式(推荐)
spring:redis:host: 10.21.1.189port: 8001lettuce:cluster:refresh:adaptive: truepool:max-active: 8