redis 连接失败问题报错 Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to 10.0.023.3:6379


主要报错内容:

Caused by: 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 10.0.023.3:6379
Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to 10.0.023.3:6379

 追踪问题一直以为redis密码错误,最好尝试很多办法依旧没有解决,使用jedis连接却是正常的!!!

解决办法最后在redis 官网问题反馈里找到了答案:

因为使用的spring boot 高版本导致的 

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.6</version>
        <relativePath/> 
    </parent>

高版本的存在bug 官方也没有进行修复

        <dependency>
                <groupId>io.lettuce</groupId>
                <artifactId>lettuce-core</artifactId>
            </dependency>

降低版本就行了

       <dependency>
                <groupId>io.lettuce</groupId>
                <artifactId>lettuce-core</artifactId>
                <version>5.3.7.RELEASE</version>
            </dependency>

问题已解决


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM