redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
使用哨兵模式连接redis连接池时,遇到错误:
Caused by: redis.clients.jedis.exceptions.JedisDataException:
ERR Client sent AUTH, but no password is set
发现是redis没有设置密码,程序却发送了auth选项。
工程里JedisSentinelPool是通过spring配置的:
<bean id="jedisPool" class="redis.clients.jedis.JedisSentinelPool" destroy-method="destroy">
<constructor-arg value="${redis.master}" />
<constructor-arg>
<set>
<value>${redis.host}:${redis.port}</value>
</set>
</constructor-arg>
<constructor-arg ref="jedisPoolConfig" />
<constructor-arg value="${redis.timeout}"/>
</bean>
发现JedisSentinelPool的构造方法有2个类似的:
public JedisSentinelPool(String masterName, Set sentinels,
GenericObjectPoolConfig poolConfig, int timeout) {
this(masterName, sentinels, poolConfig, timeout, null, 0);
} public JedisSentinelPool(String masterName, Set sentinels,
GenericObjectPoolConfig poolConfig, String password) {
this(masterName, sentinels, poolConfig, 2000, password);
}
JedisSentinelPool初始化构造方法的入参是根据spring配置文件的参数配置顺序加载的,JedisSentinelPool使用了第二个构造方法,导致上面的错误。
解决方法,给配置文件的参数配置name属性.
<bean id="jedisPool" class="redis.clients.jedis.JedisSentinelPool" destroy-method="destroy">
<constructor-arg name="masterName" value="${redis.master}" />
<constructor-arg name="sentinels">
<set>
<value>${redis.host}:${redis.port}</value>
</set>
</constructor-arg>
<constructor-arg name="poolConfig" ref="jedisPoolConfig" />
<constructor-arg name="timeout" value="${redis.timeout}"/>
</bean>
问题解决
redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set的更多相关文章
- Redis错误:jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
原文链接:http://blog.csdn.net/rchm8519/article/details/48347797 redis.clients.util.Pool.getResource(Pool ...
- redis.clients.jedis.exceptions.JedisDataException: ERR invalid DB index
添加redis配置文件, 启动后,调用报错 redis.clients.jedis.exceptions.JedisDataException: ERR invalid DB index ERR i ...
- 【问题集】redis.clients.jedis.exceptions.JedisDataException: ERR value is not an integer or out of range
redis.clients.jedis.exceptions.JedisDataException: ERR value is not an integer or out of range incrm ...
- 【异常】redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'PSETEX'
在spring中 针对 RedisTemplate类: private RedisTemplate<String, String> template; 当调用下面方法 template.o ...
- 阿里云 Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR invalid password
如果你是买的阿里云的redis服务的话,不要被这个ERR invalid password所迷惑了. 你应该去检查一下你买的服务有没有设置白名单. 像mysql和mongodb的服务如果连不上的话也可 ...
- ERR Unsupported CONFIG parameter: notify-keyspace-events; nested exception is redis.clients.jedis.exceptions.JedisDataException
异常信息 时间:2017-04-05 15:53:57,361 - 级别:[ WARN] - 消息: [other] The web application [ROOT] appears to hav ...
- redis.clients.jedis.exceptions.JedisDataException :READONLY You can't write
分布式直连同步调用测试时出现的错误:主从复制架构下,默认Slave是只读的,如果写入则会报错: redis.clients.jedis.exceptions.JedisDataException: R ...
- redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots
最近在学习Redis ,在写test测试的时候碰到这个报错: redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is c ...
- Caused by: redis.clients.jedis.exceptions.JedisDataException: READONLY You can't write against a read only slave.
Caused by: redis.clients.jedis.exceptions.JedisDataException: READONLY You can't write against a rea ...
随机推荐
- HttpClient 教程 (二)
第二章 连接管理 HttpClient有一个对连接初始化和终止,还有在活动连接上I/O操作的完整控制.而连接操作的很多方面可以使用一些参数来控制. 2.1 连接参数 这些参数可以影响连接操作: 'ht ...
- 微信小程序实例教程(三)
第七章:微信小程序编辑名片页面开发 编辑名片有两条路径,分为新增名片流程与修改名片流程. 用户手填新增名片流程: 首先跳转到我们的新增名片页面 1 需要传递用户的当前 userId,wx.na ...
- 如何高效的用判断用js判断ie6
用js判断ie6的方法有很多,如: 1. var isIE=!!window.ActiveXObject; var isIE6=isIE&&!window.XMLHttpRequest ...
- 在MAC下配置MySQL 5.7 数据库的编码问题
1.MySQL 5.7 for MAC 默认没有my.cnf文件 ,首先 新建my.cnf文件: 2.在my.cnf文件追加 [mysqld] character-set-server=utf8mb4 ...
- phpmailer 的使用
[转载]http://blog.csdn.net/liruxing1715/article/details/7914974 <?php header('Content-Type:text/htm ...
- iOS JsonModel
iOS JsonModel 的使用 本文转自:http://blog.csdn.net/smking/article/details/40432287 下面讲一下JSONModel的使用方法. @in ...
- LNMP(Linux+Nginx+Mysql+PHP---源码)环境搭建
LNMP(Linux+Nginx+Mysql+PHP(Perl)) Linux:[root@dep5 mysql]# cat /etc/issueRed Hat Enterprise Linux Se ...
- ICE BOX 配置,使用----第一篇
一 理论部分 (1) 为什么要使用icebox? icebox server代替了通常的server. icebox是为了方便集中管理多个ice服务而建立的. 它通过使用icebox服务器,把ice服 ...
- ZOJ 3930 Dice Notation
简单模拟题.一个int写成了char,搞了4个多小时.真垃圾.. #include<stdio.h> #include<string.h> +],s[+]; +]; +]; i ...
- net stop 出现1060错误
net stop时出现1060错误,答案: 原来,net stop后面不能想当然地加上服务,而要在‘服务’里看看,那个服务究竟叫什么名字. 比如,我的mysql安装时不叫mysql,而是mysql5 ...