在使用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.的更多相关文章

  1. 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 ...

  2. Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out

    问题: java连接不上redis. 异常信息: Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.ne ...

  3. redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect time out

    redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect ti ...

  4. redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

    超时 Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: jav ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. redis.clients.jedis.exceptions.JedisDataException: ERR invalid DB index

    添加redis配置文件, 启动后,调用报错  redis.clients.jedis.exceptions.JedisDataException: ERR invalid DB index ERR i ...

  9. 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 ...

随机推荐

  1. linux inode 详解 / 线上inode爆满解决方案

    本文大量参考阮一峰大神博客,整理笔记 之所以写inode文章是由于一次线上问题,引发对inode深入的思考. 磁盘的inode监控与磁盘空间的监控同等重要,线上服务器一定要做好磁盘inode与磁盘空间 ...

  2. koltin语言学习(一)——什么是koltin

    转自:Koltin China (一) 介绍 #Kotlin-for-Android-Dev 1. 什么是Kotlin? Kotlin是JetBrains开发的基于JVM的语言.Kotlin是使用Ja ...

  3. wsgiref分析

    """Generic socket server classes. This module tries to capture the various aspects of ...

  4. ASP.NET 使用alert弹出对话框后,CSS样式失效,字体变大的解决方法

    protected void ASPxButton2_Click(object sender, EventArgs e) { //Response.Write("<script> ...

  5. Installing PHP5 on Ubuntu Server

    When installing PHP 5 from source I ran into the following problems and solutions: Problem:configure ...

  6. PHP 支持 JQuery 的 JSONP 跨域访问

    Jquery Ajax进行跨域时需要使用JSONP,但JSONP格式和JSON格式是有区别的,如果直接返回JSON格式就会报错 首先将原有的Jquery代码中的dataType改成“jsonp”,具体 ...

  7. RabbitMQ系列教程之二:工作队列(Work Queues)(转载)

    RabbitMQ系列教程之二:工作队列(Work Queues)     今天开始RabbitMQ教程的第二讲,废话不多说,直接进入话题.   (使用.NET 客户端 进行事例演示)          ...

  8. 记录Git的安装过程

    从https://git-scm.com/download/win,选择Windos版本下载. 选择打开的工具,用的Notepad. 下一步 下一步

  9. 讲一讲Servlet和JSP的关系

    Test.jsp在运行时首先被解析成一个java类Test_jsp.java,该类继承于org.apache.jasper.runtime.HtppJspBase类,而Http又是继承HttpServ ...

  10. [C语言]使用数组

    ----------------------------------------------------------------------------- // main.c 例 // Created ...