4

我有一个有 3 个节点的 cassandra 环,有 3 个节点的 hadoop 环和有 3 个节点的 solr 环都在同一个集群中。

我的计划是将数据写入 cassandra 环并使用 cassandra DC 复制我将数据复制到其他两个环(Hadoop 和 solr)

我为 cassandra 环使用了 vnode,我需要为 hadoop 和 solr 使用令牌,因为 hadoop/solr 不支持 vnode。

我的问题是如何为 murmur3 分区器生成多个数据中心令牌?

4

2 回答 2

1

在多 DC 设置中,您可以选择一个 DC 并为一个 DC 中的节点均匀计算令牌。其他 DC 中的节点将具有相同的令牌 + 一些偏移量,以便令牌是唯一的。Cassandra 包作为帮助您计算代币的工具:

https://www.geroba.com/cassandra/cassandra-token-calculator/

于 2014-01-29T21:32:50.367 回答
0

TL;DR;
Use vnodes, token calculation is done for you.

You'd do it normally but then just add 100 (anything between 100 and 1000 allows you to fail on bootstrapping more than 10 times without worrying about running into issues where the new nodes auto-join on a previous attempt to the tokens in the second DC. (thanks Joaquin!))

E.g. (notice the last 3 figures in each token)

DC1

  1. -9223372036854775808
  2. -3074457345618258603
  3. 3074457345618258602

DC2

  1. -9223372036854775708
  2. -3074457345618258503
  3. 3074457345618258502

Old docs, but still valid.

于 2014-02-11T19:36:02.347 回答