AWS 和 Auto Scaling cassandra [英] AWS and auto scaling cassandra

查看:17
本文介绍了AWS 和 Auto Scaling cassandra的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个带有 cassandra 的 AWS 实例,然后还设置了一个自动缩放组,以根据警报启动另外 4-8 个实例.但是 Cassandra 如何知道自动缩放何时开始?它如何知道要连接到哪些其他节点?我是否需要在 Cassandra 中配置一些东西才能嗅探节点?

I've setup a AWS instance with cassandra on it and then also setup an auto scaling group to spin up another 4-8 instances depending on alarma. But how does Cassandra know when auto scaling kicks in? How does it know what other nodes to connect to? Do I need to configure something in Cassandra in order for it to sniff the nodes?

当我运行节点工具时,自动缩放节点不显示...

when I run node tool, the auto scaling nodes don't show up...

[root@ip-10-205-119-104 bin]# sh nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns    Host ID                               Rack
UN  127.0.0.1  107.12 MB  256     ?       a50294ac-2150-4d9e-9dd2-0a56906e9531  rack1

Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless

推荐答案

Cassandra 中自动发现的最佳选择是种子节点,它们是锚"节点,在新的出现了,每次需要的时候都可以查询集群的节点列表.

The best option for auto-discovery in Cassandra are seed nodes, which are 'anchor' nodes supposed to be always there when a new one shows up, and can be queried for cluster's node list every time it is needed.

因此,您在其配置文件中为每个节点提供种子节点列表(包括种子本身),一旦它上升,它将从种子中获取节点列表.当然,这要求种子节点保持静态并始终运行(当然,为了冗余,您必须拥有多个种子节点).Cassandra 还要求按他们的 IP 列出它(以避免出现 DNS 问题).

So, you deliver every node with a list of seed nodes in its config file (including the seeds themselves), and once it goes up, it will get the nodes list from a seed. This, off course, demands seed nodes to be static and always running (off course, for redundancy, you must have more than just one seed node). Cassandra demands it to be listed by their IP as well (to avoid having problems with DNS).

尽管如此,我认为自动缩放 Cassandra 并不是一件好事.Cassandra 跨节点分区其数据(行),每次添加或删除节点时,它都需要重新分区和重新分配行,这取决于您的数据有多大,这需要很长时间(并且可能需要其他管理操作,例如维修等).即使您有足够的副本来承受突然的节点丢失(这是使用自动缩放会发生的情况),这也很麻烦.首先,因为 Cassandra 不会自动解除节点 - 集群会知道该节点不可用,但它只是等待它回来,并尝试保持集群尽可能健康(包括一种将写入保存到一段时间内其他节点不可用的节点).

Nonetheless, I don't think auto-scaling Cassandra would be a good thing. Cassandra partitions its data (rows) across nodes, and every time you add or remove a node, it needs to repartition and redistribute rows, which, depending on how big are you data, takes quite long (and may demand other administrative actions, like repairing, etc). Even if you have enough replicas to afford a sudden node loss (which is what WILL occur using auto-scaling), that's messy. First, because Cassandra won't automatically decomission nodes - the cluster will know the node is unavailable, but it just waits for it to come back, and try to keep the cluster as healthy as possible (including a mechanism that saves the writes to the unavailable node in other nodes for some period).

因此,您需要监视节点并从外部管理这些起伏.而且,您甚至可能没有时间停用一个节点并在另一个节点启动和关闭之前将所有内容(您的数据)重新设置到位,而所有这些都可能真的把您的集群完全搞砸.

So, you would need to watch your nodes and manage those ups and downs from outside. And, you may not even have time for decomission one node and set everything (your data) in place again before another one comes up, and down again, and all that could really screw your cluster totally up.

好吧,也许有些人在这样做,但根据我对 Cassandra 的了解和经验,它不像使用 Web 应用程序那样自动缩放那么简单和神奇,而且您可能会最终会丢失数据并导致系统非常不一致和不稳定.

Well, maybe there's some people out there doing this, but according to my knowledge and experience with Cassandra, it's not so simple and magic as that to be auto-scaled like you would do with a web application, and you would probably end up losing data and having a very inconsistent and unstable system.

这篇关于AWS 和 Auto Scaling cassandra的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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