hadoop - 具有多个数据中心的 Cassandra 中的副本放置逻辑

标签 hadoop cassandra-2.0

当写入以一致性 EACH_QUORUM 和复制 4 与 2 个数据中心 DC1 和 DC2 副本放置 3 在 DC1 和 1 在 DC2 中执行时,哪个类选择第二个和第三个副本应该驻留的节点?告密者是 GossipingPropertyFileSnitch 和 NetworkTopologyStrategy。客户端使用 FileSystem.create 创建一个新文件并对其执行写入操作。第一个副本将根据 token 和行键哈希转到节点。第二个和第三个副本在 DC1 和 DC2 中去了哪里?

最佳答案

一致性级别与放置策略没有任何关系。很简单,在向客户端报告成功或失败之前,应该向协调器报告多少个节点。

每个 DC 根据其复制因子独立放置副本。所以在DC2中,只会按照分区函数存储唯一的副本。在 DC1 中,副本放置是根据以下文档完成的:http://www.datastax.com/docs/1.0/cluster_architecture/replication#networktopologystrategy

The NetworkTopologyStrategy determines replica placement independently within each data center as follows:

The first replica is placed according to the partitioner (same as with SimpleStrategy). Additional replicas are placed by walking the ring clockwise until a node in a different rack is found. If no such node exists, additional replicas are placed in different nodes in the same rack. NetworkTopologyStrategy attempts to place replicas on distinct racks because nodes in the same rack (or similar physical grouping) can fail at the same time due to power, cooling, or network issues.

关于hadoop - 具有多个数据中心的 Cassandra 中的副本放置逻辑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28574210/

相关文章:

json - Apache PIG,JSON加载程序

java - 缓解 Hadoop 的跟腱问题

exception - Cassandra 中的 TombstoneOverwhelmingException

python - 在Python中使用多处理来改善Cassandra写入指令不起作用

cql3 - cassandra 中列的默认排序顺序?

hadoop - Drop Hive Table和MSCK修复失败,表存储在Google云存储桶中

hadoop - 如何防止 CDH 中的 Hue 在重启时清除作业历史记录?

hadoop - 尝试以AVRO格式存储时,PIG脚本错误:基准2不在联合中[“null” ,“string”]

Hive 查询执行错误,从 MapredLocalTask​​ 返回代码 3

cassandra - 如何列出键空间中的列族?