首页 \ 问答 \ 如何测试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 ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)