原文:spring boot 集成 redis 出現 “Unable to connect to localhost:6379”

當訪問到代碼 時,出現以下錯誤: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhos ...

2021-08-26 23:45 0 769 推薦指數:

查看詳情

Springboot集成redis Unable to connect to localhost:6379

首先排除redis服務器的問題,將redis 配置文件中的 bind 127.0.0.1 注釋掉,然后將保護模式關閉 protected-mode no ,以服務端啟動redis ./redis-server ./redis.conf 然后修改本地項目配置文件,將redis相關配置 ...

Sat Oct 09 01:03:00 CST 2021 0 365
Unable to connect to 192.168.126.132:6379

首先檢查配置文件中的 ip 地址、端口號寫沒寫錯,因為有時候centos在待機時端口號會自己變 然后再去看redis.conf文件中看 bind 屬性, 默認情況bind=127.0.0.1只能接受本機的訪問請求 不寫的情況下,無限制接受任何ip地址的訪問 所以就把所有 ...

Fri Apr 01 21:08:00 CST 2022 0 883
Spring Boot 集成 Redis

Spring Boot 集成 Redis 引入依賴 pom文件引入Redis依賴spring-boot-starter-data-redis <!--redis依賴配置--> <dependency> <groupId> ...

Wed Oct 28 01:52:00 CST 2020 0 403
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM