There has been proposals to add a force/unsafe flag to alter DC but it hasn't been actioned and at this rate seems unlikely to make it into 4.0. There is however a workaround, albeit not very user friendly. You should be able to modify the system_schema tables directly to do your DC updates. I am yet to test it out myself so don't know the updates you'd need to make but you should be able to get a good idea by querying, doing updates and observing the effect.
raft.so - Cassandra consulting, support, managed services On Sat., 20 Feb. 2021, 02:29 Paul Chandler, <p...@redshots.com> wrote: > All, > > We have a use case where we need to change the datacenter name for a > cassandra cluster, we have a script to do this that involves a short > downtime. This does the following > > > 1) Change replication factor for the system key spaces to be { ‘OLD_DC’ : > ‘3’, ’NEW_DC”: ‘3’ } > 2) Change the dc value in cassandra-rackdc.properties to NEW_DC for each > node > 3) Add -Dcassandra.ignore_dc=true in cassandra-env.sh for each node > 4) Stop all nodes > 5) Start each seed node, then start the rest of the nodes > 6) change the replication factor for all the keyspaces to { ’NEW_DC”: > ‘3’ } > > In 3.11.x this all works fine and the cluster is good to be used again > after step 6. > > However in 4.0 step 1 is now blocked by the following change "Cassandra > will no longer allow invalid keyspace replication options, such as invalid > datacenter names for NetworkTopologyStrategy” > > If you skip step 1) then when the nodes come back up, you cannot login > because the system_auth keyspace still has a replication factor of ‘OLD_DC’ > : ‘3’ but there are no nodes in the dc OLD_DC so the keyspace cannot be > accessed. > > Is there a way around this to change the name of the datacenter? > > > Thanks > > Paul > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@cassandra.apache.org > For additional commands, e-mail: user-h...@cassandra.apache.org > >