【问题篇】解决Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介: 【问题篇】解决Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException


我遇到这个问题是因为,默认安装的redis是没有密码的,刚安装时就把redis挂在后台了,导致最后我修改配置文件,修改密码之后,并没有重启redis,然后我再springboot项目yml配置里面配置了密码(此刻,实际上redis还是没有密码的,因为没有重启redis),所以会有上面的报错,解决办法就是重启redis即可。

1、修改redis的密码

修改两个配置文件

找到两个文件的如图位置设置密码,注意空格(两个文件都要修改)

2、重启服务

打开任务管理器

找到redis, 右键->重启服务。

3、连接redis的配置

总结:重启redis即可。

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
3月前
|
负载均衡 NoSQL Java
|
3月前
|
XML Java Maven
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
55 0
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
|
26天前
|
Kubernetes 容器 Perl
error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is cu
error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is cu
21 0
|
2月前
Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider解决
Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider解决
95 0
|
3月前
|
NoSQL Linux 网络安全
解决Caused by: java.net.SocketTimeoutException: connect timed out Exception in thread “main“ redis.cli
解决Caused by: java.net.SocketTimeoutException: connect timed out Exception in thread “main“ redis.cli
|
3月前
|
负载均衡 NoSQL Java
redis7.0源码阅读(四):Redis中的IO多线程(线程池)
redis7.0源码阅读(四):Redis中的IO多线程(线程池)
77 0
|
16天前
|
NoSQL Linux Redis
06- 你们使用Redis是单点还是集群 ? 哪种集群 ?
**Redis配置:** 使用哨兵集群,结构为1主2从,加上3个哨兵节点,总计分布在3台Linux服务器上,提供高可用性。
230 0
|
25天前
|
负载均衡 监控 NoSQL
Redis的集群方案有哪些?
Redis集群包括主从复制(基础,手动故障恢复)、哨兵模式(自动高可用)和Redis Cluster(官方分布式解决方案,自动分片和容错)。此外,还有如Codis、Redisson和Twemproxy等第三方工具用于代理和负载均衡。选择方案需考虑应用场景、数据规模和并发需求。
201 2
|
30天前
|
NoSQL Redis
Redis集群(六):集群常用命令及说明
Redis集群(六):集群常用命令及说明
194 0
|
2月前
|
运维 NoSQL 算法
Redis-Cluster 与 Redis 集群的技术大比拼
Redis-Cluster 与 Redis 集群的技术大比拼
82 0