Cassandra群集-迁移群集中的所有主机 [英] Cassandra cluster - Migrating all hosts in cluster

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

问题描述

我使用的Cassandra(3.5)具有20个节点,数据中心1具有10个节点,而数据中心2具有10个节点,并且具有大量数据.所有主机都属于旧主机.现在我们有了新一代的主机,例如第二代.

I am using Cassandra(3.5) with 20 nodes with data center-1 with 10 nodes and data center-2 with 10 nodes and has huge data. All hosts belong to say legacy hosts. Now we have newer generation hosts say generation-2.

我尝试添加新节点并停用旧节点.但这会消耗很多领带.

I have tried adding new nodes and decommissioning old node. But this will be tie consuming.


问题1:如何将所有主机从旧式主机迁移到第二代主机?最好的方法是什么?
Q2:什么是回滚策略?
Q3:最后,一旦迁移到第二代主机,如何验证数据?


Q1: How can I migrate all hosts from legacy hosts to generation-2 host? What is the best approach for that?
Q2: What will be rollback strategy?
Q3: Finally, How can I validate data once I migrate to generation-2 hosts?

推荐答案

如果仅用较新的硬件替换节点,并保持相同数量的节点,那么这很简单(应该在每个节点上进行操作):

If you just replacing the nodes with newer hardware, keeping the same number of nodes, then it's simple (operations should be done on every node):

  1. 在每个节点上准备新安装,其配置与现有节点相同,但具有不同的IP地址,但不启动节点
  2. (可选)使用 nodetool disableautocompaction 禁用自动压缩-这可以帮助更快地执行步骤5
  3. 使用 rsync 将数据从旧节点复制到新节点(这可能需要很长时间)
  4. 执行 nodetool流失&停止旧节点
  5. 使用 rsync 同步自初始复制以来发生的更改(应该相对较快)
  6. 确保旧节点不会再次启动(例如,删除Cassandra软件包)-否则可能会造成混乱
  7. 启动新节点
  1. prepare the new installation on every node, with configuration identical to existing nodes, but with different IP addresses but don't start the nodes
  2. (optional) disable autocompaction with nodetool disableautocompaction - this could help to execute step 5 faster
  3. copy data from old node to new node using rsync (this could take long time)
  4. execute nodetool drain & stop old node
  5. use rsync to synchronize changes happened since initial copying (it should be relatively fast)
  6. make sure that the old node won't start again (for example, remove Cassandra package) - otherwise it could be a chaos
  7. start the new node

之所以可行,是因为Cassandra节点由存储在本地表中的UUID标识,因此更改IP不会影响操作.

This works because Cassandra node is identified by the UUID that is stored in the local table, so changing of IP doesn't affect the operations.

P.S.将来,如果您需要更换节点(未如描述的那样,但已完全失效),请使用

P.S. In future, if you'll need to replace node (not as described, but completely died), use the procedure of node replacement - in this case, you won't stream data twice, as happened when you do decomissioning and then re-adding node.

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

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