redis.clients.jedis.exceptions.JedisException: Can connect to sentinel, but seems to be not monitored.
在使用Redis的哨兵Sentinel配置时,报错如下:
redis.clients.jedis.exceptions.JedisException: Can connect to sentinel, but myMaster seems to be not monitored.
报错原因:
可能是因为哨兵配置sentinel.conf中的服务器名称,和程序中哨兵连接池配置的服务器名称不一致导致的。
解决方法:
查看哨兵配置 sentinel.conf,如下:
sentinel monitor mymaster 192.168.0.102 6379 2
其中的 哨兵配置中的服务器名称为 mymaster。
接着再看java程序中的JedisSentinelPool配置的哨兵名称:
JedisSentinelPool sentinelPool=new JedisSentinelPool("myMaster",sentinelSet,jedisPoolConfig);
程序中的服务器名称为myMaster。
可以看到,sentinel.conf中配置的服务器名称和程序中的服务器名称不一样,因此报错。。将程序中的服务器名称改正就解决了。
redis.clients.jedis.exceptions.JedisException: Can connect to sentinel, but seems to be not monitored.的更多相关文章
- redis使用问题一:Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a resource from the pool] with root cause
本文使用的是spring-data-redis 首先说下redis最简单得使用,除去配置. 需要在你要使用得缓存得地方,例如mybatis在mapper.xml中加入: <cache evict ...
- Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
问题: java连接不上redis. 异常信息: Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.ne ...
- redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect time out
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect ti ...
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
超时 Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: jav ...
- redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
使用哨兵模式连接redis连接池时,遇到错误: Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sen ...
- 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报错:java.net.SocketException: Broken pipe (Write failed); nested exception is redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe (Write failed)
最近写了一个服务通过springboot构建,里面使用了redis作为缓存,发布到服务器运行成功,但是有时候会报redis的错误:org.springframework.data.redis.Redi ...
- redis.clients.jedis.exceptions.JedisDataException: ERR invalid DB index
添加redis配置文件, 启动后,调用报错 redis.clients.jedis.exceptions.JedisDataException: ERR invalid DB index ERR i ...
- jedisCluster 报错: redis.clients.jedis.exceptions.JedisClusterException: No way to dispatch this command to Redis Cluster because keys have different slots.
根本原因:jedisCluster不支持mget/mset等跨槽位的操作. 版本:2.9.0 解决办法,推荐更改redis的驱动修改为: lettuce lettuce 项目地址:https://gi ...
随机推荐
- [多线程]wait和notify
线程之间的通信 使用wait/notify方法实现线程间的通信.这两个方法都是Object类的方法,也就是说Java所有的对象都提供这两个方法.1.wait和notify必须配合synchroni ...
- oracle 相关操作
1,SqlPlus 的使用 1.01,软登入:sqlplus /nolog 1.02,登入 dba 用户:sqlplus /as sysdba 2,用户相关操作 2.01,创建用户:create us ...
- PHP + Apache 在 Linux(centos7)系统下的环境搭建,基于 yum
(本文采用的是 Centos7 的操作系统,简单起见,以下全部采用 yum 安装,有这么好用的东西为什么要自己去一个一个编译呢) 1, 安装 Apache => yum -y install ...
- php 中文转拼音,可以只转首字母,可以设置utf8、gbk
<?php class Pinyin { /** * 默认是gb编码,第二个参数随意设置即为utf8编 * @param type $isInitial 是否只返回首字母 * @return t ...
- jquery元素使用
特殊用法: var formFields = $([]).add(_ele1).add(_ele2); 可将多个元素整合到一个集合中 1.has方法 has()方法查找自己,has为子集条件,即包含 ...
- eclipse工作区(workspace)常用设置(preferences)
切换工作区 新建一个作为工作区的文件夹 File -> Switch Workspace -> Other... -> browse,定位到新的指定工作区文件夹即可. 切换到新的工作 ...
- eclipse中导入java类失败的问题
在 Eclips 开发时,新建了一个 Dynamic Web Project,在运行jsp文件时tomcat报错: org.apache.jasper.JasperException: Unable ...
- 尚硅谷springboot学习2-微服务
2014年,martin flowler发表关于微服务的博客 微服务是一种架构风格:一个应用应该是一组小型服务:可以通过HTTP的方式进行互通: 单体应用:ALL IN ONE 微服务:每一个功能元素 ...
- python语言中的数据类型之列表
数据类型及内置方法 列表: list 可变类型,有序 用途:用来记录多个值(同属性) 定义方式:在[ ]内用逗号分隔开多个任意类型的值 l=['a','b','c'] #l=list(['a' ...
- 多线程中的join总结笔记
join方法的原理 就是调用相应线程的wait方法进行等待操作的,假如线程1中调用了线程2的join方法,则相当于在线程1中调用了线程2的wait方法,当线程2执行完(或者到达等待时间),线程2会自动 ...