nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 127.0.0.1/<unresolved>:6401
时间: 2023-10-21 19:24:25 浏览: 197
根据提供的引用内容,"nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 127.0.0.1/<unresolved>:6401"是一个Redis连接异常的嵌套异常。解决这个问题的方法有以下几种:
1. 编辑redis.conf文件,可以使用vim命令打开/etc/redis.conf文件,检查Redis配置文件中的连接设置是否正确。
2. 在启动类上添加注解@SpringBootApplication(exclude = {RedisAutoConfiguration.class}),可以排除自动配置中的Redis相关配置,以避免连接异常的发生。
3. 如果已经存在@SpringBootApplication注解,可以叠加添加排除Redis自动配置的注解@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, RedisAutoConfiguration.class})。这样可以同时排除数据源和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 ]
阅读全文