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>

问题已解决

posted @ 2022-02-16 16:47  石头三  阅读(3400)  评论(0编辑  收藏  举报