简体   繁体   English

备份和还原cassandra群集有哪些不同的方法?

[英]What are different ways to backup and restore cassandra cluster?

I am trying to backup the whole cluster consistently. 我试图一致地备份整个群集。 What are different ways to backup and restore Cassandra cluster? 备份和还原Cassandra群集有哪些不同的方法?

If you are using the DataStax Enterprise version, then the easiest way is to perform the backups and restore using OpsCenter. 如果使用的是DataStax Enterprise版本,那么最简单的方法是使用OpsCenter执行备份和还原。

If you are using the DataStax Community or open-sourced version of Cassandra, then use nodetool snapshot to create backups of tables and/or keyspaces. 如果您使用的是DataStax社区或Cassandra的开源版本,请使用nodetool snapshot创建表和/或键空间的备份。

Please bear in mind that SSTables are immutable, ie they never change once they are written to disk. 请记住,SSTable是不可变的,即,一旦将它们写入磁盘,它们就永远不会改变。 So unlike RDBMS data files, SSTables are not updated. 因此,与RDBMS数据文件不同,SSTables不更新。

To perform a snapshot cluster-wide, use SSH tools such as pssh to perform parallel snapshots on all nodes. 要在整个群集范围内执行快照,请使用pssh等SSH工具在所有节点上执行并行快照。

More information on the snapshot utility is available here . 有关snapshot实用程序的更多信息, 请参见此处

There are several ways to restore from snapshots. 有几种从快照还原的方法。 One way is to re-load the data using the sstableloader tool where the data is read back into the cluster. 一种方法是使用sstableloader工具重新加载数据,在sstableloader工具中将数据读回到集群中。 Another way is by copying the SSTable directory from snapshot and running nodetool refresh . 另一种方法是通过从快照复制SSTable目录并运行nodetool refresh Finally, you can replace the existing data with the snapshot and restarting the node. 最后,您可以用快照替换现有数据并重新启动节点。

More information on backups and restores are available here . 有关备份和还原的更多信息, 请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM