如何测试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

相关问答

更多

Backbone.js集合选项(Backbone.js collection options)

@ Paul的答案是好的,但也值得注意的是, url属性可以是一个函数。 在我看来(这只是意见,因为最终的结果是一样的),代码更清晰,如果更详细,如果你设置id在initialize和引用它在一个函数: var Messages = Backbone.Collection.extend({ initialize: function(models, options) { this.id = options.id; }, url: function() { return '...

Backbone.js集合(Backbone.js Collection)

我能够找出问题,并决定在这里张贴,这样另一个人就不必像我一样继续抨击他们的头脑了。 在PostView视图类中,我必须在collection.fetch()中包装下划线.each我注意到模型是在集合回调属性中返回的。 所以我做的是添加以下内容; render:function () { this.$el.html(''); this.$el.append(this.template(this)); that = this; this.collection.fet...

backbone.js:视图中的按钮,它影响集合中的不同模型(backbone.js: Button in view that affects a different model in collection)

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

Backbone.js:模型,集合,路由器,何时以及为何?(Backbone.js: Model, Collection, Router, when and why?)

这个问题没有真正正确的答案。 肯定有不止一种方法可以使它工作,这是关于Backbonejs的好东西之一:它非常灵活,并且不会对你施加太多的设计选择。 如果我要开始构建你所描述的内容,我肯定会: Question模型 Questions集 用于呈现单个问题的QuestionView 用于显示问题列表的QuestionsIndexView 在那之后,事情变得有点模糊,这取决于您对应用程序的要求。 如果您希望状态像传统网站一样存储,您可以使用路由器并执行类似下面的操作: ApplicationRout...

Backbone.js集合url(Backbone.js collection url)

我将假设您并不是指路由器中的new AuthorList ,而是new AvailableBookList 。 您的收藏中有两个问题: 在您的网址定义中, this指的是window对象。 您在构造函数中传递的id参数未应用于您的集合实例。 它仅适用于视图(不适用于模型或集合)。 要解决第一个问题,您可以使用函数来定义集合URL,这将使您进入正确的范围: AvailableBookList = Backbone.Collection.extend({ model: AvailableBook,...

无法从模板中访问Backbone.js集合/模型(Cannot access Backbone.js collection / models from with in template)

如果你的代码真的如你的问题所示,问题是你在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 h...

Backbone.js或其他MVC提供什么?(What does Backbone.js or other MVC offer?)

Backbone.js,underscore.js和jQuery(它们都是相互依赖的)是一个实用的抽象层和javascript工具集,允许您组织业务逻辑,模板和模型。 这样做的主要好处是代码可读性(适用于具有多个成员的长期项目/项目),围绕离散部件组织的一般良好实践(例如,保持HTML不受业务逻辑影响),提供时间来处理硬件/项目的有趣部分,而不是重新发明不同的浏览器兼容性问题,以及(在下划线的情况下)一个伟大的工具集,以帮助您管理javascript对象,数组,函数等安全和理智的编程。 基本上,如...

Backbone.js View可以有模型和集合吗?(Can a Backbone.js View have a Model and a Collection?)

是的,你可以简单地传递它: 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.collecti...

相关文章

更多

redis集群插槽分配-redis集群管理

使用cluster nodes命令查看当前集群信息 192.168.56.101:6382> ...

redis 集群环境搭建-redis集群管理

集群架构 (1)所有的redis节点彼此互联(PING-PONG机制),内部使用二进制协议优化传输速度 ...

redis新增集群节点-redis集群管理

新增一个节点6383,并启动 执行redis-trib.rb add-node命令添加节点 redi ...

redis删除集群节点-redis集群管理

先查看一下集群节点信息: 192.168.56.101:6382> cluster nodes 0 ...

redis集群出现宕机没法访问-redis集群管理

先来查看集群节点信息 192.168.56.101:6382> cluster nodes ...

redis 集群使用主从复制架构-redis集群管理

redis集群使用主从架构如下图,能有效解决集群中节点连接不上造成集群挂掉的情况 a) 在Redis ...

redis安装-redis集群管理

安装redis [root@master opt]# mkdir /opt/redis [root ...

redis主从从架构搭建-redis集群管理

主从从架构 [root@master redis-master-slave]# vim 6382/re ...

Redis概述

什么是Redis Redis是Remote Dictionary Server的缩写, Redis是一 ...

Redis Cookbook

Two years since its initial release, Redis already ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本