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