具有大量数据的 ec2 上的最佳实践 cassandra 设置 [英] Best practice cassandra setup on ec2 with large amount of data

查看:24
本文介绍了具有大量数据的 ec2 上的最佳实践 cassandra 设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在进行从物理机到 ec2 实例的大规模迁移.

I am doing a large migration from physical machines to ec2 instances.

截至目前,我有 3 个 x.large 节点,每个节点有 4 个实例存储驱动器(raid-0 1.6TB).设置完这些后,我想起实例存储卷上的数据仅在关联的 Amazon EC2 实例的生命周期内持续存在;如果您停止或终止实例,实例存储卷上的任何数据都会丢失."

As of right now I have 3 x.large nodes each with 4 instance store drives (raid-0 1.6TB). After I set this this up I remembered that "The data on an instance store volume persists only during the life of the associated Amazon EC2 instance; if you stop or terminate an instance, any data on instance store volumes is lost."

在这种情况下,人们通常会怎么做?我担心如果其中一个盒子崩溃,那么如果它不是 100% 复制到另一个盒子上,那么该盒子上的所有数据都将丢失.

What do people usually do in this situation? I am worried that if one of the boxes crash then all of the data will be lost on that box if it is not 100% replicated on another.

http://www.hulen.com/?p=326我在上面的链接中读到这些人使用临时驱动器并使用 EBS 驱动器和快照定期备份内容."

http://www.hulen.com/?p=326 I read in the above link that these guys use ephermal drives and periodically backup the content using the EBS drives and snapshots."

在这里的这个问题:我该怎么做aws ec2 实例/临时存储的备份?人们声称您无法将临时数据备份到 EBS 快照上.

In this question here: How do I take a backup of aws ec2 instance/ephemeral storage? People claim that you cannot backup ephermal data onto EBS snapshots.

将几个 EBS 驱动器和 raid0 一起使用并能够直接从它们获取快照是我的最佳选择吗?我知道这可能是最昂贵的解决方案,但是,它似乎最有意义.

Is my best choice to use a few EBS drives and raid0 them together and be able to take snapshots directly from them? I know this is probably the most expensive solution, however, it seems to make the most sense.

任何信息都会很棒.

感谢您的宝贵时间.

推荐答案

我在 EC2 上运行 Cassandra 已经 2 年多了.为了解决您的顾虑,您需要在 EC2 上为您的 Cassandra 集群形成适当的可用性架构.这是一个供您考虑的项目符号列表:

I have been running Cassandra on EC2 for over 2 years. To address your concerns, you need to form a proper availability architecture on EC2 for your Cassandra cluster. Here is a bullet list for you to consider:

  1. 考虑至少 3 个地区来设置您的集群;
  2. 使用 NetworkTopologyStrategy 和 EC2Snitch/EC2MultiRegionSnitch 将数据副本传播到每个区域;这意味着每个区域中的机器将合并您的完整数据集;例如, strategy_options 将类似于 {us-east:3}.

以上两个技巧应该满足 AWS 中的基本可用性,如果您的查询是使用 LOCAL_QUORUM 发送的,即使一个区域出现故障,您的应用程序也能正常运行.

The above two tips should satisfy basic availability in AWS and in case your queries are sent using LOCAL_QUORUM, your application will be fine even if one zone goes down.

如果您担心 2 个区域会出现故障(在我使用的过去 2 年中不记得它发生在 AWS 中),那么您还可以向您的集群添加另一个区域.

If you are concerned about 2 zones going down (don't recall it happened in AWS for the past 2 years of my use), then you can also add another region to your cluster.

以上,如果任何节点因任何原因死亡,您可以从其他区域的节点恢复它.毕竟,CAssandra 旨在为您提供这种可用性.

With the above, if any node dies for any reason, you can restore it from nodes in other zones. After all, CAssandra was designed to provide you with this kind of availability.

关于 EBS 与 Ephemeral:

About EBS vs Ephemeral:

我一直反对在任何生产中使用 EBS 卷,因为就可用性而言,它是最差的 AWS 服务之一.它们每年都会出现几次故障,而且它们的缺点通常会级联到其他 AWS 服务,例如 ELB 和 RDS.它们也像附加的网络存储,因此任何读/写都必须通过网络.不要使用它们.甚至 DataStax 也不推荐它们:

I have always been against using EBS volumes in anything production because it is one of the worst AWS service in terms of availability. They go down several times a year, and their downside usually cascades to other AWS services like ELBs and RDS. They are also like attached Network storage, so any read/write will have to go over the Network. Don't use them. Even DataStax doesn't recommend them:

http://www.datastax.com/documentation/cassandra/1.2/webhelp/index.html#cassandra/architecture/../../cassandra/architecture/architecturePlanningEC2_c.html

关于备份:

我使用称为 Priam (https://github.com/Netflix/Priam) 的解决方案由 Netflix 编写.它可以拍摄集群的夜间快照并将所有内容复制到 S3.如果您启用增量备份,它还会将增量备份上传到 S3.如果节点出现故障,您可以使用简单的 API 调用在特定节点上触发恢复.它恢复得更快,并且不会在您的其他节点上放置大量流负载.我还为它添加了一个补丁,让您可以做一些奇特的事情,例如在一个 AWS 区域内建立多个 DC.

I use a solution called Priam (https://github.com/Netflix/Priam) which was written by Netflix. It can take a nightly snapshot of your cluster and copy everything to S3. If you enable incremental_backups, it also uploads incremental backups to S3. In case a node goes down, you can trigger a restore on the specific node using a simple API call. It restores a lot faster and does not put a lot of streaming load on your other nodes. I also added a patch to it which let's you do fancy things like bringing up multiple DCs inside one AWS region.

你可以在这里阅读我的设置:http://aryanet.com/blog/shrinking-the-cassandra-集群到更少的节点

You can read about my setup here: http://aryanet.com/blog/shrinking-the-cassandra-cluster-to-fewer-nodes

希望以上有所帮助.

这篇关于具有大量数据的 ec2 上的最佳实践 cassandra 设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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