如何在Cassandra中选择分区读取 [英] How partition read is chosen in Cassandra

查看:251
本文介绍了如何在Cassandra中选择分区读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个节点,并且分区数据的数量分布在3个节点上,

I have 3 nodes with number of partition data distributed across 3 nodes,

当我用如下所示的分区键寻找端点时,

When I look for the end points with partition key like below,

./nodetool getendpoints keyspacename tablename partitionkeyvalue
172.30.56.63
172.30.56.62
172.30.56.61

我还可以从 ./ nodetool环上看到使用虚拟节点将不同的分区从-2功率63分配到+2功率63

I am also able to see from the ./nodetool ring that the different partitions are distributed from -2 power 63 to +2 power 63 using virtual nodes

我还能够看到查询到的主机(使用响应对象)它使用令牌感知策略选择协调器节点

I am also able to see the queried hosts (using the response object) that It used the token aware policy to choose the co-ordinator node

假设分区包含10亿个RF = 3的条目。请问单个分区内的数据是否为跨节点分布?还是单个cassandra节点将具有完整的分区数据,而其他两个节点将具有其完整副本?

Let's say the partition contains 1 billion entries with RF = 3. Will the data inside a single partition be distributed across nodes? Or a single cassandra node will have the complete partition data and the other two nodes will have the complete replica of it?

推荐答案

单个分区始终位于单个节点上,副本位于其他节点上。这就是为什么要建议最大分区大小的原因:在2.0&或更高版本中的数百MB。分区内的单元格数量将取决于值的平均大小,等等。-在DS220数据建模课程中,有单独的一组物理模型讲座。

The individual partition always resides on single node, with replicas on other nodes. That's why there are recommendations on the max size of partition: ~100Mb in 2.0 & below, or several hundred MBs in higher versions. The number of cells inside partition will depend on the average size of the values, etc. - in DS220 Data Modelling course there is a separate set of lectures on physical model.

这篇关于如何在Cassandra中选择分区读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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