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 ...
随机推荐
- 《算法》第四章部分程序 part 5
▶ 书中第四章部分程序,加上自己补充的代码,图的深度优先遍历 ● 无向图的广度优先遍历,有向 / 无向图代码仅若干方法名不同 package package01; import edu.princet ...
- workerman-todpole 执行流程(1)
该系列文章主要是彻底扒一下 workerman todpole 游戏的实现原理. 提前打个预防针: 由于 Worker 类的静态属性和子类对象的混用(当前类的静态属性存放当前类对象,静态方法循环静态属 ...
- c# word操作
合并单元格 http://www.360doc.com/content/11/0729/21/2097544_136620405.shtml
- ubuntu 使用sudo apt-get update命令的时候会报http://archive.ubuntukylin.com:10006/ubuntukylin/dists/xenial/InRelease 无法连接
参考: https://blog.csdn.net/xiaoyan94/article/details/52404539 于是找到一个包含 http://archive.ubuntukylin.co ...
- JAVA Spring Cloud 注册中心 Eureka 相关配置
转载至 https://www.cnblogs.com/fangfuhai/p/7070325.html Eureka客户端配置 1.RegistryFetchIntervalSecon ...
- 【ASP.NET 进阶】TreeView控件学习
这几天上班没事做,也不好打酱油,学点没接触过的新东西吧,基本了解了下TreeView控件. TreeView 控件用于在树结构中显示分层数据,例如目录或文件目录等. 下面看代码吧: 1.效果图 2.静 ...
- TP5 模型事务操作
注意:数据只要涉及多表一致性操作,必须要开启数据库事务操作 ThinkPHP5 中模型层中使用事务: try{ $this->startTrans(); $this->data($orde ...
- idea 与springboot 快捷键
ctrl + m 还原 查询 getmapping 修改默认端口号
- mysql主从复制搭建中几种log和pos详解
一.主从原理 Replication 线程 Mysql的 Replication 是一个异步的复制过程,从一个 Mysql instace(我们称之为 Master)复制到另一个 Mysql in ...
- FlashDevelop 发布SWC
环境配置: 1.安装32位Java,经测试可用的 链接:http://pan.baidu.com/s/1i4CraXR 密码:xuud 2.ant,链接:http://pan.baidu.com/s/ ...