回到目录

对于redis-sentinel我在之前的文章中已经说过,它是一个仲裁者,当主master挂了后,它将在所有slave服务器中进行选举,选举的原则当然可以看它的官方文章,这与我们使用者没有什么关系,而对于sentinel来说,它在进行主从切换时,会触发相关事件,这是和我们开发人员有关系的,如当+switch-master事件被触发时,说明当前Sentinal已经完成了一次主从的切换,并所有服务已经正常运转了。

下面是我这几天作的测试,对于Twemproxy代理和Sentinal哨兵都已经成功使用stackExchange.redis进行了连接,并正常访问了,当然Sentinel只公开了几个redis命令,这个大家要清梦,不明白的可以看我的这篇文章《Redis集群~windows下搭建Sentinel环境及它对主从模式的实际意义》。

连接普通的redis服务器

  ConnectionMultiplexer conn = ConnectionMultiplexer.Connect("127.0.0.1:6379");
  ConfigurationOptions option = new ConfigurationOptions();
option.EndPoints.Add("127.0.0.1", );
ConnectionMultiplexer conn = ConnectionMultiplexer.Connect(option);

连接TW代理服务器

    ConfigurationOptions twOption = new ConfigurationOptions();
twOption.EndPoints.Add("127.0.0.1", );
twOption.EndPoints.Add("127.0.0.1", );
twOption.Proxy = Proxy.Twemproxy;//代理的类型
ConnectionMultiplexer conn = ConnectionMultiplexer.Connect(twOption);

连接Sentinal仲裁哨兵服务器

           //连接sentinel服务器
ConfigurationOptions sentinelConfig = new ConfigurationOptions();
sentinelConfig.ServiceName = "master1";
sentinelConfig.EndPoints.Add("192.168.2.3", );
sentinelConfig.EndPoints.Add("192.168.2.3", );
sentinelConfig.TieBreaker = "";//这行在sentinel模式必须加上
sentinelConfig.CommandMap = CommandMap.Sentinel;
// Need Version 3.0 for the INFO command?
sentinelConfig.DefaultVersion = new Version(, );
ConnectionMultiplexer conn = ConnectionMultiplexer.Connect(sentinelConfig);

有了上面的代码后,我们可以成功的连接一个sentinel服务器,对这个连接的实际意义在于:当一个主从进行切换后,如果它外层有Twemproxy代理,我们可以在这个时机(+switch-master事件)通知你的Twemproxy代理服务器,并更新它的配置文件里的master服务器的地址,然后从起你的Twemproxy服务,这样你的主从切换才算真正完成。

对于Twemproxy-sentinal-master/slave主从切换实现图

我们可以使用.netcore开发一个跨平台的程序,将它放在linux的tw代理服务器上,使用dotnet run去运行它,然后当收到由sentinel发来的+switch-master事件时,将更新tw配置文件并从起它的服务。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqkAAAE8CAIAAABsB7/9AAAgAElEQVR4nO2dW2wUV4L3eZjZXe3MZqKZWe3bqD5ptcrDjrSrecm+rIy00obvYWR/HinaQGa+7BAuudjxpcEhJNxiczEBhosNg21sg2/BXG2wIQkeAsHd7QvdhkyCCJeQjt2+wY5CxBdQdL6Htpum6lR1dXdd2l2/n/6yqk+fOnXqnKrz6+o4Zp4AAAAALzHP7Q4AAACAo+B+AAAAb4H7AQAAvAXuBwAA8Ba4HwAAwFvgfgAAAG+B+wEAALwF7gcAAPAWuB8AAMBb4H4AAABvgfsBAAC8Be4HAADwFrgfAADAW+B+AAAAb4H7AQAAvAXuBwAA8Ba4HwAAwFvgfgAAAG+B+wEAALyFxP1Xz/+f4MlfEpO51v/y99//P+dnDgAgZ8A7DntH4v7gyV8+euAnZvLt3VOD3b+6HixG/wAAaYN3HPYO7s90DsIf/sf/jF9E/wAAaYN3HPYO7rdgDoQQ6B8AIG3wjsPewf3WzEGG0wAA4GXwjsPewf2WzUEm0wAA4GXwjsPeSdP9iqJkfgKWNGJHtB2Ll6jeUs1B2tMAAOBljL2TuPBKxZG0gsEybrDgmxFEeiJT9El6REu8k4L79QY3bYXHdjSYJ4OxMNl4ej3UdkxvWzsH6U0DAICXMfBOogj0vKBaoqXi0LrfwC/my7U9kepc1SvVht7nEvu8k9pzv16/04vBvpl/sMq8Y2Y+PUjnII1pAADwMlY99xu4SaV8M842+OShbU3bSTN9kB7ITH+0Y5iSd6z8zl/RfH6Rjoh2NLXzIW1f2qZqSqTVVD8NuiRtUw8D96c6DQAAXkbqHTOLsLZEaxCpEZJ62riOQYm0n2Y+uJh5S1EUS7yT2nf+BhMQr6A39MaF0reMRyFxoLV19KbEfJfMTI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A2kKn7hRD37n/3TkvI13x5U9f1xv6xpv6x5v6xJuLtxK6BxkujO3pvVhwKv7YvcC3yl8wvNgAAyBwL3B/jXHhsQ0e4sKqPkMSU1Q90Bb/il/sAALIHy9wPAAAAcwLcDwAA4C1wPwAAgLfA/QAAAN4C9wMAAHgL3A8AAOAtcD8AAIC3wP0AAADeAvcDAAB4C9wPAADgLXA/AACAt8D9AAAA3gL3AwAAeAvcDwAA4C1wPwAAgLfA/QAAAN4C9wMAAHgL3A8AAOAtcD8AAIC3+P/0GQZnTP/rrQAAAABJRU5ErkJggg==" alt="" />

希望大家对技术多一点深度的研究,找不到答案就看看它的源代码,可能会有意外的收获!

欢迎大家关注大叔博客!

回到目录

Redis集群~StackExchange.redis连接Sentinel服务器并订阅相关事件(原创)的更多相关文章

  1. Redis集群~StackExchange.redis连接Twemproxy代理服务器

    回到目录 本文是Redis集群系列的一篇文章,主要介绍使用StackExchange.Redis进行Twemproxy(文中简称TW)代理服务的连接过程,事务上,对于TW来说,我们需要理解一下它的物理 ...

  2. Redis集群~StackExchange.Redis(10月6号版1.1.608.0)连接Twemproxy支持Auth指令了

    回到目录 对于StackExchange.Redis这个驱动来说,之前的版本在使用Proxy为Twemproxy代理时,它是不支持Password属性的,即不支持原始的Auth指令,而我也修改过源代码 ...

  3. redis集群之REDIS CLUSTER

    redis集群之REDIS CLUSTER 时间 2016-04-11 17:05:00  NoSQL_博客园 原文  http://www.cnblogs.com/zhanchenjin/p/537 ...

  4. Redis集群教程(Redis cluster tutorial)

    本博文翻译自Redis官网:http://redis.io/topics/cluster-tutorial        本文档以温和的方式介绍Redis集群,不使用复杂的方式来理解分布式系统的概念. ...

  5. Redis集群~windows下搭建Sentinel环境及它对主从模式的实际意义

    回到目录 关于redis-sentinel出现的原因 Redis集群的主从模式有个最大的弊端,就是当主master挂了之前,它的slave从服务器无法提升为主,而在redis-sentinel出现之后 ...

  6. Redis集群_3.redis主从自动切换Sentinel(转)

    Redis SentinelSentinel(哨兵)是用于监控redis集群中Master状态的工具,其已经被集成在redis2.4+的版本中 一.Sentinel作用:1):Master状态检测 2 ...

  7. redis集群搭建及连接(阿里云)

    阿里云上面装redis集群基本被虐死,主要问题就是私有IP和公有IP. 下面分享成功搭建的步骤: 两台测试服务器,分别为:127.0.0.1,127.0.0.2.每分服务器有3个节点. 1.127.0 ...

  8. 在虚拟机上安装redis集群,redis使用版本为4.0.5,本机通过命令客户端可以连接访问,外部主机一直访问不了

    在虚拟机上安装了redis 4 ,启动后本机客户端可以连接访问,但是外部主机一直访问不了,在使用java代码连接redis集群时报:no reachable node in cluster,原因:在r ...

  9. redis高可用、redis集群、redis缓存优化

    今日内容概要 redis高可用 redis集群 redis缓存优化 内容详细 1.redis高可用 # 主从复制存在的问题: 1 主从复制,主节点发生故障,需要做故障转移,可以手动转移:让其中一个sl ...

随机推荐

  1. Xamarin +vs2015 Android 开发GPS loaction 返回 null 小结

    最近公司要开发android 所以研究了一下Xamarin  to android 中个GPS 废话不多说,说重点. 想获取手机上的gps信息必不可少的就是要使用 LocationManager Lo ...

  2. 学习maven的使用,看到一篇很实用的入门教程(菜鸟级入门)

    一.前言         早就知道maven 在java 项目的管理方面名声显赫,于是就想着学习掌握之,于是查阅了大量文档.发现这些文档的作者都是java 的大腕,大多都是站在掌握了一定maven 基 ...

  3. <转>简单之美——系统设计黄金法则

    作者: 包云岗  发布时间: 2012-05-19 13:06  阅读: 3036 次  推荐: 1   原文链接   [收藏] 最近多次看到系统设计与实现的文章与讨论,再加上以前读过的其他资料以及自 ...

  4. linux时钟基本概念、CST与UTC、以及NTP简单设置

    1,安装linux的时候在设置时间的时候有一个选项:system clock uses UTC,那么这个UTC是什么意思呢? 世界协调时间(Universal Time Coordinated,UTC ...

  5. Make Notepad++ auto close HTML/XML tags after the slash(the Dreamweaver way)

    I've been looking for a Notepad++ plugin that can close HTML/XML tags after a slash just like the wa ...

  6. E9相关技术链接

    1.飞思卡尔i.MX6q安装ubuntu14.04操作系统:http://demo.netfoucs.com/bzw073/article/details/42551399 2. DS-5社区版安装: ...

  7. CreateCompatibleDC 与 CreateCompatibleBitmap 小小结

    通常使用CreateCompatibleBitmap时候都会用到CreateCompatibleDC.而是用CreateCompatibleDC的目的不是为CreateCompatibleBitmap ...

  8. PHP如何将中文转换为拼音

    用来得到中文的首字母: 这个是将中文转换为拼音的类:charset <?php/*** 汉字转化为拼音,拼音转化为汉字**/ class charset{private $_code=array ...

  9. day11---异步IO\数据库\队列\缓存

    一.RabbitMQ队列 RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统.他遵循Mozilla Public License开源协议. MQ全称为Message Queue, 消息 ...

  10. C#常用代码集合(1)

    引用自james li的博客,地址:http://www.cnblogs.com/JamesLi2015/p/3147986.html   1 读取操作系统和CLR的版本   OperatingSys ...