redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
来源:互联网 发布:2017网络写手排行榜 编辑:程序博客网 时间:2024/04/30 12:59
使用哨兵模式连接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>
问题解决
0 0
- redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
- 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
- redis异常解决: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
- redis异常解决:jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
- Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password
- Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password
- JedisDataException: ERR Client sent AUTH, but no password is set
- Redis:ERR Client sent AUTH, but no password is set
- ERR Client sent AUTH,but no password is set
- 连接redis报此错误:ERR Client sent AUTH, but no password is set
- 解决问题redis问题:ERR Client sent AUTH, but no password is set
- 连接redis报此错误:ERR Client sent AUTH, but no password is set
- 解决问题redis问题:ERR Client sent AUTH, but no password is set
- Redis中 ERR Client sent AUTH, but no password is set异常
- Java链接Redis时出现 “ERR Client sent AUTH, but no password is set” 异常的原因及解决办法
- redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'SENTINEL'
- VS2015下解决:error LNK2019: 无法解析的外部符号 __iob_func
- B+树在mysql数据库索引中的使用
- ArcGIS反距离权重法插值应用
- 业务对象的贫血模型与充血模型
- 大型网站架构演变
- redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
- 大型网站架构要素及常用手段
- C#笔记6——操作JSON(Newtonsoft)
- 大型网站架构之WEB前端优化
- 大型网站架构之应用服务器集群化
- robots规范写法与用途
- Android 实现滚动图片
- 大型网站架构之分布式缓存
- db_recovery_file_dest_size 100%used引发的web页面故障