手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Redis Sentinel集群方案--单机测试

[日期:2014-02-03] 来源:Linux社区  作者:luyx30 [字体: ]

启动master和master-sentinel:

Redis-server --include /usr/local/redis_cluster/master-6379/redis.conf

redis-sentinel /usr/local/redis_cluster/master-6379/6379-sentinel.conf

克隆会话,启动slave1和slave1-sentinel:

redis-server --include /usr/local/redis_cluster/slave-6479/redis.conf

redis-sentinel /usr/local/redis_cluster/slave-6479/6479-sentinel.conf

克隆会话,启动slave2和slave2-sentinel:

redis-server --include /usr/local/redis_cluster/slave-6579/redis.conf

redis-sentinel /usr/local/redis_cluster/slave-6579/6579-sentinel.conf

查看master的状态:

redis-cli -h 127.0.0.1 -p 6379

image

查看slave的状态:

redis-cli –h 127.0.0.1 –p 6479

image

4.测试:

----场景1:slave宕机

关闭slave1:

image

查看sentinel状态:

image

查看master的Replication信息:

此时只存在一个slave。

image

----场景2:slave恢复

重新开启slave1:

redis-server /usr/local/redis_cluster/slave-6479/redis.conf

查看sentinel状态:

sentinel能快速的发现slave加入到集群中:

image

查看master的Replication信息:

image

linux
相关资讯       Redis集群  Redis Sentinel 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款