如何启动新节点 [英] How to bring up the new node

查看:82
本文介绍了如何启动新节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是来自 Cassandra中的高可用性的后续问题

1)假设我们有三个节点N1,N2和N3,我有RF = 3,WC = 3和RC = 1,那么这意味着我

1) Let's say we have three nodes N1, N2 and N3, I have RF =3 and WC = 3 and RC = 1, then which means I cannot handle any node failure in case of write.

2)比方说,如果N3(想象它保存了数据)掉了,到现在我们将无法问题1:现在,如果我启动一个新的Node N4并将其附加到群集上,我仍然不会将数据写入一致性为 3的数据。

2) Let's say If the N3 (Imagine It holds the data) went down and as of now we will not be able to write the data with the consistency as '3'.

能够以一致性3写入群集,那么如何使节点N4充当第三个节点?

Question 1: Now If I bring a new Node N4 up and attach to the cluster, Still I will not be able to write to the cluster with consistency 3, So How can I make the node N4 act as the third node?

问题2:我的意思是说我们有7个节点集群,RF = 3,那么如果任何持有副本的节点出现故障,有没有办法使现有的其他节点

Question 2: I mean let's say we have 7 node cluster with RF = 3, then If any node holding the replica went down, Is there a way to make existing other nodes in the cluster to act as a node holding the partition?

推荐答案

查看文档:

https:// docs。 datastax.com/zh-CN/cassandra/3.0/cassandra/operations/opsReplaceNode.html

您要替换方案中的死节点。应从环上取下N3并用N4代替。

You want to replace a dead node in your scenario. N3 should be removed from the ring and replaced by N4.

应该很容易逐步遵循该说明。至关重要的是,如果您通过软件包管理安装了该节点,请先停止该节点,然后再对其进行新配置,并从中清除所有现有数据,缓存和提交日志(通常在 / var / lib / cassandra / *下找到) )。

It should be easy to follow that instructions step by step. It is critial that if you installed the node via package mangement to stop it before configuring it new and to wipe out all existing data, caches and commitlogs from it (often found under /var/lib/cassandra/*).

此外,也可以使用 nodetool removenode 如此处所述 http://docs.datastax.com /en/cassandra/2.1/cassandra/tools/toolsRemoveNode.html 和此处 https://docs.datastax.com/en/cassandra/3.0/cassandra/operations/opsRemoveNode.html -这会从群集中删除该节点(并且应确保该节点不会出现之后,请先清除其数据)。

Also it is possible to remove a dead node from the ring with nodetool removenode as described here http://docs.datastax.com/en/cassandra/2.1/cassandra/tools/toolsRemoveNode.html and here https://docs.datastax.com/en/cassandra/3.0/cassandra/operations/opsRemoveNode.html - this removes the node from your cluster (and you should ensure that it cant come back after that before wiping out its data).

请记住,它只会从环中删除死节点,并将令牌范围分配给其余节点,但是不会自动进行流式传输。删除失效的节点后,您将需要朗诵 nodetool repair

Remember it only removes a dead node from the ring and assigns the token ranges to the remaining nodes, but no streaming will happen automatically. You will need to rum nodetool repair after removing a dead node.

如果要删除活动节点,可以使用 nodetool停用-但如上所述,请确保该节点执行不能通过清除数据重新进入集群。

If you want to remove a live node you can use nodetool decommission - but as above, ensure the node does not reenter the cluster by wiping out it's data.

更新:

Cassandra中的节点没有以内部N1,N2等方式命名。 。节点有一个uuid,它们拥有它们负责的所谓令牌范围。

Nodes in Cassandra are not "named" in that fashion N1, N2, etc. internally. The nodes have an uuid and they own so called token ranges which they are responsible for.

如果节点已关闭-如果可能的话,只需对其进行修复,将其重新联机以将其加入您的集群-如果该时间少于默认的3个小时,精细。否则,请运行 nodetool repair

If a node is down - simply repair it if possible at all, bring it online again to join it your cluster - if that took less than the default 3 hours you are fine. Otherwise run nodetool repair.

但是,如果节点完全丢失并且永远不会回来,请运行 nodetool removenode 在该死节点上。这要求cassandra将死节点负责的令牌范围分配给其余节点。之后,运行 nodetool repair ,以便节点将流失丢失的数据。之后,您的集群现在将少一个节点,因此它将是六个节点。

But if the node is 'lost' completely and will never come back, run nodetool removenode on that dead node. This asks cassandra to assign the token ranges the dead node was responsible for to the remaining nodes. After that run nodetool repair so the nodes will stream the data which is missing. After that your cluster will now have one node less, so it will be six nodes.

这篇关于如何启动新节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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