1、报错信息:

17:14:57.951 [boundedElastic-1] WARN  o.s.b.a.r.RedisReactiveHealthIndicator - [handleFailure,89] - Redis health check failed
org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.60.1:6379at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.translateException(LettuceConnectionFactory.java:1689)at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1597)at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1383)at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1366)at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedReactiveConnection(LettuceConnectionFactory.java:1117)at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:509)at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:103)at reactor.core.publisher.MonoSupplier.call(MonoSupplier.java:86)

原因:是整个项目中都引入了健康检查依赖:`

    <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency>`

然后项目启动的时候会检查到我redis是否会被用到,用不到redis就会报错;就算redis是开启的状态也会报错(刚开始还以为是redis不能被外界连接导致,或者是自己的redis配置写得有问题)

解决方法:重写方法,覆盖RedisHealthIndicator中默认去检查redis的方法;

@Configuration
public class RedisHealthIndicator implements HealthIndicator {@Overridepublic Health health() {return Health.up().build();}
}

刚开始自己还以为是因为docker拉取的redis有问题
1、尝试了关闭虚拟机防火墙
2、尝试了修改redis.conf文件的配置

springboot项目启动报连接redis的相关错误相关推荐

  1. SpringBoot项目启动报错[类文件具有错误的版本 61.0, 应为 55.0 请删除该文件或确保该文件位于正确的类路径子目录中。]

    Web server failed to start. Port 80 was already in use. Web server failed to start. Port 80 was alre ...

  2. SpringBoot项目启动报错:Field userMapper in com.demo.controller.MemberController required a bean of type ‘c

    问题描述: SpringBoot项目启动报错,报错内容:'com.xxx.mapper.XxxxMapper' that could not be found ******************** ...

  3. SpringBoot项目启动 报错:Error executing Maven. end tag name </settings> must match start tag name

    SpringBoot项目启动 报错:Error executing Maven. end tag name must match start tag name from line xxx 第一次创建s ...

  4. idea软件 springboot项目启动报错:命令行太长解决

    idea软件 springboot项目启动报错:命令行太长解决 1.找到项目下得.idea文件夹,打开文件workspace.xml 2.搜索标签 <component name="P ...

  5. springboot项目启动报错-案例情景介绍

    文章目录 摘要 情况1:Nacos报错 情况2:IllegalStateException: Incompatible fallbackFactory instance 情况3:idea编译java文 ...

  6. 【图文详解】SpringBoot项目启动报错:The bean ‘xxxServiceImpl‘ could not be injected as a ‘xxxServiceImpl‘ ...

    问题描述: 项目启动报错:The bean 'xxxServiceImpl' could not be injected as a 'cn.xxxx.service.xxxServiceImpl' b ...

  7. SpringBoot项目启动报xxx.FeignClientSpecification问题的原因及解决办法

    今天在启动项目的时候,idea控制台突然打印了The bean 'user.FeignClientSpecification', defined in null, could not be regis ...

  8. SpringBoot项目启动报错,java.lang.IllegalStateException: Ambiguous mapping.访问路径模棱两可,无法映射的问题!!!

    问题描述: SpringBoot项目刚启动就报错 下面是报错信息: 我这里提取了一下关键信息 Ambiguous mapping.(模棱两可的mapping) Cannot map 'test' me ...

  9. 【踩坑日记】springboot项目启动报错error create bean with name

    前言 启动springboot项目报错error create bean with name xxx 以为是哪个bean没有装配上,排查了所有的bean,发现都装配了 原因分析 仔细看了报错日志,发现 ...

最新文章

  1. Page 的生命周期学习小结
  2. 【对讲机的那点事】节日出游对讲机选择你了解多少?
  3. 【Java版】将汉字转化为gb2312编码
  4. ABAP runtime error CALL_FUNCTION_ILL_DECFLOAT_LEN
  5. 前端学习(1648):前端系列实战课程之任务功能清单思路
  6. jenkins用ssh agent插件在pipeline里实现scp和远程执行命令
  7. 暑期训练日志----2018.8.24
  8. 使用TensorFlow.js进行人脸触摸检测第1部分:将实时网络摄像头数据与深度学习配合使用
  9. 正则表达式**************************
  10. python模型训练框架_Pytorch-Transformers 1.0发布,支持六个预训练框架,含27个预训练模型...
  11. python函数详解图_[宜配屋]听图阁
  12. C#利用SharpZipLib解压或压缩文件夹实例操作
  13. 用python画皮卡丘-教你用Python画一只属于自己的皮卡丘
  14. 汇编语言寄存器相关知识(AX/BX/CX/DX+mov/add+物理地址+段+CS/IP+jmp)
  15. Alexa工具条解密
  16. 压缩文件密码暴力破解——cRARk使用方法
  17. linux分配oracle内存,【学习笔记】Linux系统 ORACLE用户进程占用私有内存分析
  18. 23种设计模式之策略模式——小鸭子的故事
  19. 世界名牌大学课件下载地址
  20. Linux里怎么打开pt文件,在 Linux 上安装 transmission 进行远程 PT 下载

热门文章

  1. ionic android 禁止截屏设置
  2. vscode中code runner使用c++17标准
  3. 运行django,一个非常可笑的错误Cannot resolve keyword 'price_gte' into field. Choices are: category,
  4. 转一篇关于制作三维立体画的文章以及其源码
  5. Latex中宏包总结
  6. python标准库的图像处理模块_Python图像处理库PIL的ImageFont模块使用介绍
  7. 收银系统连接授权服务器失败,超市收银系统错误-COMException 依赖服务或组无法启动(0x8007042C)处理办法...
  8. 国标28181:国标编码
  9. Origin作图流程
  10. js创建文件并压缩成zip