集群故障转移 [英] Cluster Failover

查看:37
本文介绍了集群故障转移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我在问一些关于集群故障转移的非常明显的问题.

I know I'm asking something very obvious about cluster failover.

我在 redis.io 上读到,如果任何主集群节点发生故障,它将影响其他主节点,直到从节点开始负责.在我的结构中,我没有定义任何奴隶,只是与 3 个主人一起工作.

I read on redis.io that, if any master cluster node fails it will affect to other master nodes until slave come to take in charge. In my structure, I'm not defining any slave and just working with 3 masters.

我正在考虑修改 redis-trib.rb 文件,这将删除有缺陷的服务器,并将启动与其他 2 个节点的集群.我对一些事情感到困惑,

I'm thinking to modify the redis-trib.rb file, which will remove the defected server and will start the cluster with other 2 nodes. I'm confused about a couple of things,

1) 重新分片

在失败的服务器上线之前是不可能的

Could not possible until failed server goes live

2) 创建集群的最少 3 个节点限制

2) Minimum 3 node limitation for create cluster

据了解,redis-trib.rb 不允许我为两个节点创建集群代码文件中可能有一些解决方案:)

As per bit understanding, redis-trib.rb not allowing me to create cluster for two nodes There might be some solution in code file :)

3) 使用活动节点重新创建新结构的自动方式

3) Automatic Way to Re-Create new structure with live nodes

从程序员的角度来看,我正在为我的系统搜索一些自动的东西.当 Redis 集群失败时,某些任务会在内部触发一个命令.喜欢

As programmer point of view, I'm searching something automatic for my system. Something that trigger one command when Redis Cluster fails some tasks happens internally. like

  • 关闭所有其他 redis 集群服务器
  • 从所有集群节点文件夹中删除 nodes-[port].conf 文件
  • 启动redis集群服务器
  • 运行redis-trib.rb create ip:port ip:port"

我只是想尽量减少管理工作:).否则我需要在这里实现一些其他算法数据一致性".

I'm just trying to minimize administration work :). Otherwise I need to implement some other algorithm "Data Consistency" here.

如果你们有任何解决方案或想法,请分享.

If any of you guys have any solution or idea, kindly share.

谢谢,桑杰·莫纳尼

推荐答案

在只有主节点的集群中,如果一个节点出现故障,数据就会丢失.因此无法重新分片,因为无法将数据(哈希槽)迁移出故障节点.

In a cluster with only master nodes, if a node fails, data is lost. Therefore no resharding is possible, since it is not possible to migrate the data (hash slots) out of the failed node.

为了在主节点发生故障时保持集群正常工作,您需要从节点(每个主节点一个).这样,当一个 master 失败时,它的 slave 会进行故障转移(成为具有相同数据副本的新 master).

To keep the cluster working when a master fails, you need slave nodes (one per master). This way, when a master fails, its slave fails over (becomes the new master with the same copy of the data).

redis-trib.rb 脚本不处理少于 3 个 master 的集群创建,但是在 redis-cluster 中,集群可以是任意大小(至少一个节点).

The redis-trib.rb script does not handle cluster creation with less than 3 masters, however in redis-cluster a cluster can be of any size (at least one node).

因此,添加从节点可被视为自动解决您的问题.

Therefore adding slave nodes can be considered an automatic solution to your problem.

这篇关于集群故障转移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆