On Thu, Feb 22, 2018 at 8:11 PM, Jon Haddad <j...@jonhaddad.com> wrote:
> Great question. Unfortunately, our OSS docs lack a step by step process > on how to add a DC, I’ve created a JIRA to do that: > https://issues.apache.org/jira/browse/CASSANDRA-14254 > Thanks. I'd love to contribute as well, just need some questions to be clarified, maybe even on this thread. The datastax docs are pretty good for this though: https://docs.datastax. > com/en/cassandra/latest/cassandra/operations/opsAddDCToCluster.html > I don't understand why should this be relevant if the question was about creating multi-DC cluster *from scratch*. There is no need to care about auto_boostrap (as discussed above) or use nodetool rebuild. The only detail is that you might want to use NetworkTopologyStrategy for system keyspaces as well, which is pre-requisite when using rebuild, but not required when creating from scratch. Regarding token allocation, it was random prior to 3.0. In 3.0 and up, it > is calculated a little more intelligently. > But not by default. To use the new token allocation you need specify allocate_tokens_for_keyspace in cassandra.yaml (or in JVM_OPTS). The thing is, if it's a new cluster, there are no user keyspaces yet. So you'll have to work around by starting at least one node (which incidentally gets random tokens), then creating your data keyspace, and only then continue to add more nodes with the setting allocate_tokens_for_keyspace=mydata_ks. This is a bit unfortunate, since the only information the token allocator actually needs from the keyspace is the replication factors (it doesn't care about name, replication strategy or actual load on the existing nodes). The folks at DataStax realized that soon enough, so in DSE the setting is now called 'allocate_tokens_for_local_replication_factor' and the other one is deprecated: https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__allocate_tokens_for_local_replication_factor I believe it would make sense to Apache Cassandra adopt this change, but I don't see a JIRA for that. Should I open one? in 3.11.2, which was just released, CASSANDRA-13080 was backported which > will help out when you add your second DC. If you go this route, you can > drop your token count down to 16 and get all the benefits with no drawbacks. > This is important, because if you would like to use it on 3.0, it will not work unless you make sure that auto_boostrap is *not* set to false. This is not critical when creating DCs from scratch, but requires you to hop through quite some loops if you already have some data and you want to add a new DC. Full details in this email thread: https://lists.apache.org/thread.html/396f2d20397c36b9cff88a0c2c5523154d420ece24a4dafc9fde3d1f@%3Cuser.cassandra.apache.org%3E Cheers, -- Alex