首页 \ 问答 \ 如何测试redis集群(how to test redis cluster)

如何测试redis集群(how to test redis cluster)

我有一个Redis集群,有3个主人。 我对数据持久性不感兴趣,因为这是一个缓存解决方案。 我在Windows上运行v3.2。 当我手动停止其中一个服务器以查看我是否仍然可以访问数据库时,我得到'CLUSTERDOWN集群出现故障'。 即使这样做,我也必须连接到仍在工作的其中一个实例。 我不知道这是如何实现高可用性的解决方案。 我希望我错过了一些东西。 当其中一个节点关闭时我无法访问群集的任何想法? 谢谢。

群集创建命令:ruby.exe redis-trib.rb create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002


I have a Redis cluster with 3 masters. I am not interested in data persistence since this is a caching solution. I am running v3.2 on Windows. When I stop one of the servers manually to see if I can still access the db, I get 'CLUSTERDOWN The cluster is down error'. And even to do that, I have to connect to one of the instances that is still working. I don't see how this is a solution for high availability. I hope that I am missing something. Any ideas why I can't access the cluster when one of the nodes is down? Thank you.

Cluster create command:ruby.exe redis-trib.rb create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002


原文:https://stackoverflow.com/questions/45806296
更新时间:2022-07-18 07:07

最满意答案

是的,你可以简单地传递它:

new view({model: m, collection: c});

在视图中,你可以访问:

this.model
this.collection

例如, jsfiddle


Yes, you can pass it in as simply as:

new view({model: m, collection: c});

and inside the view you can access both with:

this.model
this.collection

jsfiddle for example

相关问答

更多
  • @ Paul的答案是好的,但也值得注意的是, url属性可以是一个函数。 在我看来(这只是意见,因为最终的结果是一样的),代码更清晰,如果更详细,如果你设置id在initialize和引用它在一个函数: var Messages = Backbone.Collection.extend({ initialize: function(models, options) { this.id = options.id; }, url: function() { return '/mess ...
  • 我能够找出问题,并决定在这里张贴,这样另一个人就不必像我一样继续抨击他们的头脑了。 在PostView视图类中,我必须在collection.fetch()中包装下划线.each我注意到模型是在集合回调属性中返回的。 所以我做的是添加以下内容; render:function () { this.$el.html(''); this.$el.append(this.template(this)); that = this; this.collection.fetch({s ...
  • var col = this.model.collection; var nextModel = col.at( col.indexOf(this.model) + 1) if(nextModel) nextModel.set({whatevar}); 您不需要跟踪父集合,骨干就是为您做的。 你应该检查你是否也在集合的末尾。 var col = this.model.collection; var nextModel = col.at( col.indexOf(this.model) + 1) if(ne ...
  • 这个问题没有真正正确的答案。 肯定有不止一种方法可以使它工作,这是关于Backbonejs的好东西之一:它非常灵活,并且不会对你施加太多的设计选择。 如果我要开始构建你所描述的内容,我肯定会: Question模型 Questions集 用于呈现单个问题的QuestionView 用于显示问题列表的QuestionsIndexView 在那之后,事情变得有点模糊,这取决于您对应用程序的要求。 如果您希望状态像传统网站一样存储,您可以使用路由器并执行类似下面的操作: ApplicationRouter = ...
  • 我将假设您并不是指路由器中的new AuthorList ,而是new AvailableBookList 。 您的收藏中有两个问题: 在您的网址定义中, this指的是window对象。 您在构造函数中传递的id参数未应用于您的集合实例。 它仅适用于视图(不适用于模型或集合)。 要解决第一个问题,您可以使用函数来定义集合URL,这将使您进入正确的范围: AvailableBookList = Backbone.Collection.extend({ model: AvailableBook, ur ...
  • 如果你的代码真的如你的问题所示,问题是你在fetch返回之前呈现视图,这就是你的集合为空的原因。 fetch需要一些时间才能返回,但是你在调用fetch后立即调用render 。 在fetch函数的成功处理程序中调用render ,或将render绑定到集合的reset事件。 If your code is truly as shown in your question, the issue is that you are rendering the view before the fetch has re ...
  • Backbone.js,underscore.js和jQuery(它们都是相互依赖的)是一个实用的抽象层和javascript工具集,允许您组织业务逻辑,模板和模型。 这样做的主要好处是代码可读性(适用于具有多个成员的长期项目/项目),围绕离散部件组织的一般良好实践(例如,保持HTML不受业务逻辑影响),提供时间来处理硬件/项目的有趣部分,而不是重新发明不同的浏览器兼容性问题,以及(在下划线的情况下)一个伟大的工具集,以帮助您管理javascript对象,数组,函数等安全和理智的编程。 基本上,如果您选择不 ...
  • 是的,你可以简单地传递它: new view({model: m, collection: c}); 在视图中,你可以访问: this.model this.collection 例如, jsfiddle Yes, you can pass it in as simply as: new view({model: m, collection: c}); and inside the view you can access both with: this.model this.collection j ...

相关文章

更多

最新问答

更多
  • python的访问器方法有哪些
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。
  • 响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)
  • 在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)
  • NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)
  • 元素上的盒子阴影行为(box-shadow behaviour on elements)
  • Laravel检查是否存在记录(Laravel Checking If a Record Exists)
  • 设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)
  • 想学Linux 运维 深圳有哪个培训机构好一点
  • 为什么有时不需要在lambda中捕获一个常量变量?(Why is a const variable sometimes not required to be captured in a lambda?)
  • 在Framework 3.5中使用服务器标签<%=%>设置Visible属性(Set Visible property with server tag <%= %> in Framework 3.5)
  • AdoNetAppender中的log4net连接类型无效(log4net connection type invalid in AdoNetAppender)
  • 错误:发送后无法设置标题。(Error: Can't set headers after they are sent. authentication system)
  • 等待EC2实例重启(Wait for an EC2 instance to reboot)
  • 如何在红宝石中使用正则表达式?(How to do this in regex in ruby?)
  • 使用鼠标在OpenGL GLUT中绘制多边形(Draw a polygon in OpenGL GLUT with mouse)
  • 江民杀毒软件的KSysnon.sys模块是什么东西?
  • 处理器在传递到add_xpath()或add_value()时调用了什么顺序?(What order are processors called when passed into add_xpath() or add_value()?)
  • sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
  • 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
  • AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
  • SQL查询,其中字段不包含$ x(SQL Query Where Field DOES NOT Contain $x)
  • PerSession与PerCall(PerSession vs. PerCall)
  • C#:有两个构造函数的对象:如何限制哪些属性设置在一起?(C#: Object having two constructors: how to limit which properties are set together?)
  • 平衡一个精灵(Balancing a sprite)
  • n2cms Asp.net在“文件”菜单上给出错误(文件管理器)(n2cms Asp.net give error on Files menu (File Manager))
  • Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
  • 湖北京山哪里有修平板计算机的