nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 127.0.0.1/<unresolved>:6401
时间: 2023-10-21 22:24:25 浏览: 116
在这个问题中,nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 127.0.0.1/<unresolved>:6401的错误可能是由于与Redis服务器的连接问题引起的。为了解决这个问题,你可以尝试以下几种方法:
1. 检查redis.conf配置文件: 使用vim或其他编辑器打开redis.conf配置文件(通常位于/etc/redis.conf),确保Redis服务器的IP地址和端口号正确配置。验证IP地址和端口号与你的应用程序中的配置是否匹配。
2. 排除Redis自动配置: 在启动类上添加@SpringBootApplication(exclude = {RedisAutoConfiguration.class})注解,这将排除Spring Boot自动配置的Redis连接。这可以解决一些与Redis连接相关的问题。
3. 叠加添加注解: 如果@SpringBootApplication注解已经存在,可以叠加添加@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, RedisAutoConfiguration.class})注解,这将同时排除Spring Boot自动配置的数据源和Redis连接。
注意:请根据你的具体情况选择适用的解决方法,并确保配置信息正确无误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [本地连接远程redis(nested exception is io.lettuce.core.RedisConnectionException: Unable to )](https://blog.csdn.net/qq_50330658/article/details/124318854)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [RedisConnectionException: Unable to connect to localhost:6379](https://blog.csdn.net/TT_QY/article/details/123702407)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文